1
votes

In iOS App, to launch an application from safari, the URL scheme is something like this, Launch App from URL
is it possible to re-direct URL to Appstore pointing to the App if the particular app is not installed in the device,
Basically what i am looking

  • If app is already installed then let it be launch from the URL "A"
  • if app is not installed let it point to app store and promot user to download app,

there are examples of how to link to app to app store, but not able to add condition in the js when to launch custom URL scheme if app is there, else launch app store.

Update :

the answer provided and in the comment take me to the page which says how to launch the app store with specific app that's secdonary requirement, initially i need to have some js code which can detect whether the device has an app specific to URL scheme if not then open the App Store app page

element

1
I think if you point them to the web store, then the web store will redirect to the on device app store.Dale Myers

1 Answers

3
votes

I'm not sure if you can check if a third party app is installed on your device by code. I think only when you know the url-scheme of this specific 3rd party app you can check by

BOOL canOpen = NO;
    canOpen = [[UIApplication sharedApplication] canOpenURL:url];
    if (canOpen) {
        [[UIApplication sharedApplication] openURL:url];
    } else {
[[UIApplication sharedApplication] openURL:@"itms://itunes.apple.com/us/app/mensa-essen/id742570910?ls=1&mt=8"]; }