Open the app (iOS / Android) using JavaScript with redirect redirection in the App / Play store (2016 release)

Considering: applications for the website, iOS and Android, registered urlscheme "myapp: //".

Purpose: the site has a link shown on iOS / Android devices with the application installed. By clicking on this link, you should open the application and call certain logic (processed by the application, essentially, as "universal links" from the apple, but without obscuring the links to sites).

Due to security restrictions, finding an installed application is difficult without the magic of a web browser. Given what would be the best way to try and open the application via JavaScript and trigger a backup redirect if that fails?

The solution to this topic: Is it possible to register an http + domain URL scheme for iPhone applications such as YouTube and Maps? not working with iOS10, not sure about Android.

+4
source share
1 answer

In 2016, this cannot be achieved only through Javascript

You can still use the approach on Android, but Apple has made changes to iOS 9.2, which means that on iOS devices it's almost useless.


How it worked on iOS

The way this was done in the past was an attempt to open the application in Javascript by setting window.location to the custom URI path you wanted.

window.location = "imdb://title/tt3569230";

Application not installed

, , " ". , . . iOS 7 iOS 8, , .

, Javascript , App Store. , .

window.location = 'imdb://title/tt3569230';
setTimeout(function() {
  window.location = 'itms-apps://itunes.apple.com/us/app/imdb-movies-tv/id342792525'
}, 250);

, , :

, , iOS 9 Apple "[app]" Javascript . , Javascript URI Javascript, App Store , "".

Branch.io ( : ), - iOS 9.2 Apple ( ) Apple . , iOS . , , , : .


2016

, ( , , -, ), iOS. , Universal Links iOS, , URI (, Chrome Gmail - ). .

, ( ), Pinterest, Tinder, Airbnb, Jet.com, Yummly .. , Branch.io Firebase.

+5

Source: https://habr.com/ru/post/1663633/


All Articles