Launching Facebook from my app -- blank page
I have a question regarding launching Facebook on a iPhone/iPod/iPad device. I built an application where you have a button that launches the official Facebook application (if the user doesn't have the Facebook application, it will launch it in Safari instead). So this is the code I used to launch Facebook:
NSURL *url = [NSURL URLWithString:@"fb://106452802751829"];
[[UIApplication sharedApplication] openURL:url];
But the problem is that it's showing a blank page in the Facebook application. I revised the code again, checked twice on my Facebook fan page's 开发者_如何学运维ID, but I get nothing but a blank page. So now I don't know what to do. I hope someone can help me out here with launching the actual fan page on the official Facebook application; thanks.
Check out this Wiki iPhone URL Schemes
This information comes from the iPhoneDevTools website.
NSURL *url = [NSURL URLWithString:@"fb://<insert function here>"];
[UIApplication sharedApplication] openURL:url];
You can use these options: 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 This "works" but, then again, doesn't: fb://post/ It only works if the Facebook app has previously loaded the particular post, otherwise it draws a blank.
精彩评论