如果iPhone上安装了本地的Facebook应用程序。如何从我的应用程序打开Facebook的本地应用程序的Facebook链接。在Safari开放的情况下,链接与以下相同:
www.facebook/AlibabaUS
谢谢。
解决方案这是Facebook应用程序使用的一些方案,源链接上有更多的一些方案:
示例 NSURL * url = [NSURL URLWithString:@fb:// profile / < ID>中]; [[UIApplication sharedApplication] openURL:url];方案
fb://个人资料 - 将Facebook应用程序打开到用户的个人资料
fb://朋友 - 打开Facebook应用程序到朋友列表
fb://通知 - 打开Facebook应用程序到通知列表(注意:这个URL似乎有一个错误,通知页面打开,但是不可能导航到在Facebook应用程序中的其他任何地方)
fb:// feed - 将Facebook应用程序打开到新闻Feed
fb:// events - 打开Facebook应用程序到活动页面
fb://请求 - 将Facebook应用程序打开到请求列表
fb:// notes - 打开Facebook应用程序到Notes页面
fb:// albums - 打开Facebook应用程序到相册列表
如果在打开此网址之前,您想检查用户的脸书应用程序,您可以执行以下操作(如解释如果([[UIApplication sharedApplication] canOpenURL:nsurl]){ [[...] UIApplication sharedApplication] openURL:nsurl]; } else { //像往常一样打开url }
来源
http:/ /wiki.akosma/IPhone_URL_Schemes#Facebook
If the native Facebook app is installed on the iPhone. How do I open a facebook link into the native Facebook app from my app. In the case of opening by Safari, the link is same as:
www.facebook/AlibabaUS
Thank you.
解决方案Here are some schemes the Facebook app uses, there are a ton more on the source link:
Example NSURL *url = [NSURL URLWithString:@"fb://profile/<id>"]; [[UIApplication sharedApplication] openURL:url];Schemes
fb://profile – Open Facebook app to the user’s profile
fb://friends – Open Facebook app to the friends list
fb://notifications – Open Facebook app to the notifications list (NOTE: there appears to be a bug with this URL. The Notifications page opens. However, it’s not possible to navigate to anywhere else in the Facebook app)
fb://feed – Open Facebook app to the News Feed
fb://events – Open Facebook app to the Events page
fb://requests – Open Facebook app to the Requests list
fb://notes – Open Facebook app to the Notes page
fb://albums – Open Facebook app to Photo Albums list
If before opening this url you want to check wether the user fas the facebook app you can do the following (as explained in another answer below):
if ([[UIApplication sharedApplication] canOpenURL:nsurl]){ [[UIApplication sharedApplication] openURL:nsurl]; } else { //Open the url as usual }Source
wiki.akosma/IPhone_URL_Schemes#Facebook
更多推荐
在iOS上打开Facebook应用程式的Facebook连结
发布评论