2016-05-23 75 views
0

我的目标是为社交分享创建自定义UIActivities,Google+,PinterestLinkedIn。只有本机应用程序不存在(未安装 - 表示本地共享不会出现在UIActivityViewController中),我的自定义活动才会出现在UIActivityViewController中。何我知道用户设备上是否安装了特定的应用程序?

但我不知道如何检查这些应用程序是否已安装 有没有这种可能性?

回答

2

你必须知道URL Scheme通过canOpenURL像访问应用程序:

NSURL *likedInURL = [NSURL URLWithString:@"linkedin://profile?id=[id]"]; 
if ([[UIApplication sharedApplication] canOpenURL: likedInURL]) { 
    [[UIApplication sharedApplication] openURL: likedInURL]; 
} else { 
    // There is no app installed 
} 

看看这里更多的方案:http://pureoxygenlabs.com/10-app-url-schemes-for-marketers/

我希望这可以帮助你。

相关问题