简体   繁体   中英

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. 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.

I got this answer at 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.

In your iOS app use: fb://profile/[your ID] and the facebook app will open to your page.

The URL scheme for the iOS Facebook application is:

fb://profile/(fbid)

Same problem here. fb://page/PAGE_ID is not working anymore. Note that fb://profile/(fbid) wasn't working properly on Facebook 4.x returning a "corrupted" page in both iPad and iPhone. Instead, fb://profile/(fbid)/ wall in Facebook 4.x worked well when using an iPad but didn't work with an iPhone.

fb://page/PAGE_ID was the only option that worked on both iPhone and iPad, based on my experience.

I used to use http://wiki.akosma.com/IPhone_URL_Schemes as reference, but it's currently down...

A custom URL scheme is a mechanism through which third-party apps can communicate with each other. 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. This link gives a hint on that.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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