简体   繁体   English

新Facebook iOS应用程序的自定义URL方案

[英]Custom URL scheme for new Facebook iOS app

Does anyone know what the custom URL scheme is to open a Facebook page in their new iOS app. 有谁知道自定义URL方案是什么在他们的新iOS应用程序中打开Facebook页面。 I was using fb://page/PAGE_ID however this doesn't seem to be working in the recently updated Facebook iOS app, it just opens the app but doesn't go to the required page. 我使用的是fb:// page / PAGE_ID但是这似乎不适用于最近更新的Facebook iOS应用程序,它只是打开应用程序但没有转到所需的页面。

I got this answer at developer.facebook.com : 我在developer.facebook.com上得到了这个答案:

Replace the word page with profile and it will work. 配置文件替换单词页面 ,它将工作。 Your new statement will be: 您的新陈述将是:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/247377102029332"]];

Use https://graph.facebook.com/YOUR_USERNAME to get your page ID. 使用https://graph.facebook.com/YOUR_USERNAME获取您的网页ID。

In your iOS app use: fb://profile/[your ID] and the facebook app will open to your page. 在您的iOS应用中使用: fb://profile/[your ID] ,Facebook应用将打开您的页面。

The URL scheme for the iOS Facebook application is: iOS Facebook应用程序的URL方案是:

fb://profile/(fbid) FB://简档/(FBID)

Same problem here. 同样的问题在这里 fb://page/PAGE_ID is not working anymore. fb:// page / PAGE_ID不再有效。 Note that fb://profile/(fbid) wasn't working properly on Facebook 4.x returning a "corrupted" page in both iPad and iPhone. 请注意,fb:// profile /(fbid)在Facebook 4.x上无法正常工作,在iPad和iPhone中返回“已损坏”页面。 Instead, fb://profile/(fbid)/ wall in Facebook 4.x worked well when using an iPad but didn't work with an iPhone. 相反,Facebook 4.x中的fb:/​​/ profile /(fbid)/ wall在使用iPad时运行良好,但不适用于iPhone。

fb://page/PAGE_ID was the only option that worked on both iPhone and iPad, based on my experience. 根据我的经验,fb:// page / PAGE_ID是iPhone和iPad上唯一可用的选项。

I used to use http://wiki.akosma.com/IPhone_URL_Schemes as reference, but it's currently down... 我曾经使用http://wiki.akosma.com/IPhone_URL_Schemes作为参考,但它目前已经失效了......

A custom URL scheme is a mechanism through which third-party apps can communicate with each other. 自定义URL方案是第三方应用程序可以相互通信的机制。 It doesn't allow you the provision to open a page in that particular application. 它不允许您在该特定应用程序中打开页面。 It just fires an event to bring the called Application to the foreground. 它只是触发一个事件,将被调用的应用程序带到前台。 Going through this documentation would further clear your doubts. 通过这个文档将进一步清除您的疑虑。

The new Facebook app is built using Objective-C as against previous once in HTML5 which used to support URL scheme mechanism. 新的Facebook应用程序是使用Objective-C构建的,而以前曾用HTML5构建,用于支持URL方案机制。 This link gives a hint on that. 这个链接提供了一个提示。

http://techcrunch.com/2012/08/23/facebook-for-ios-faster/ http://techcrunch.com/2012/08/23/facebook-for-ios-faster/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM