1

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.

4

2 回答 2

3

使用canOpenURL:onUIApplication查看是否有可以响应您的自定义 URL 的应用程序。如果返回 true,则使用自定义 URL 打开应用程序,否则打开 App Store 链接

于 2012-10-14T21:16:10.510 回答
0

此处已发布了类似的答案。这应该是您实现目标所需的代码:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"YOUR-URL-SCHEME://"]]) {
// Your App is installed
} else {
// Open iTunes
}
于 2012-10-14T21:22:23.810 回答