开发者

iPhone app Facebook login with different account than FB app, when Single Sign on is enabled

I'd like to use Facebook single sign on (SSO) in my iPhone app, but I would also like to get the option to users to login with a different account from the one they are logged in the official Facebook app. Ideally, the user w开发者_StackOverflowill be first sent to the Facebook app, but when she refuses to accept the sign on, the control will be sent back to my app. At this point, it would be perfect to show the old in app login view, so that she can use a different userid/password combination. Is that last step possible? Thanks!


You should use the proper library (http://three20.info/) for work with Facebook. There are all tools what you will need! In your case it will be simple code like:

Facebook *_facebook = [[Facebook alloc] initWithAppId:kAppId];
NSArray* _permissions =  [[NSArray arrayWithObjects:
                  @"read_stream", @"offline_access",nil] retain];

[_facebook authorize:_permissions delegate:self];


When the call the iOS SDK authorize method a dialog will be popped up to ask for permissions if a logged-in user of the Facebook app was found. In that dialog there should be a "Not You?" link that would give the user the option to log in as a different user.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜