开发者

Loading iPhone webviews as an Facebook SSO authenticated user?

I've successfully integrated the Facebook iOS SDK into my iPhone project, and can make graph requests, so I know that I've got my authentication tokens and permissions working properly.

My problem is that when I开发者_如何学Python try to pass a Facebook url into a UIWebView (to look at someone's profile for example, and then be able to take actions such as sending a friend-request), the webview opens up with a Sign In/Login option again there, which shouldn't happen since my user has already signed in via the FB SDK.

Interestingly, opening a url via openURL launches the Safari app and loads the page as the properly authenticated user... however, then I'm outside of my app:

NSString *url = [NSString stringWithFormat:@"http://m.facebook.com/RobertScoble"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: url]];

So my question is: is there some way of loading a webview via the facebook-ios-sdk as the authenticated user? Or, is there some way to force openURL to not load the page in Safari, but within my webview instead?

Thanks in advance!


Additionally, this is not unique to iOS. Using Facebook's Android SDK and SSO will also introduce this awkward user experience. That is, if you use webView-based facebook comments in your native android app, and you use Facebook's SSO, the comments will require the user to authenticate.

As far as I'm concerned, this is a bug in the design of the Facebook mobile SDKs.

NOTE: Choosing the non-SSO, webView authentication model will allow all embedded facebook plugins to work as expected. At least this is the case for Android.


Here's an answer from another thread...

http://facebook.stackoverflow.com/a/9831872/717418


Unfortunately there is no way you can do this. Facebook site keeps your authentication information (auth token) in a cookie and cookies are not shared between mobile safari and UIWebview within 3rd party apps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜