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.

有帮助吗?

解决方案

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

其他提示

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
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top