2016-05-23 72 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/

我希望這可以幫助你。

相關問題