Domanda

Launching another iPhone App from my App? This feature needs to behave like this:-

a) If the App is not installed, then open the App Store with the application selected

b) If the App is installed, then open the Application

I already have custom URL. So I am able to open given app if it is installed on iPhone. But I want to to send user to app store if it is not installed already, so that he can download the app and start using it right away

How to check if app is already installed or not?? Please help.

È stato utile?

Soluzione

use canOpenURL: on UIApplication to see if there is an app which can respond to your custom URL. If this returns true, use the custom URL to open the app, otherwise open a link to the App Store

Altri suggerimenti

A similar answer was already posted here. This should be the code you need to achieve what you are trying to:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"YOUR-URL-SCHEME://"]]) {
// Your App is installed
} else {
// Open iTunes
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top