[英]Facebook Login is opening in Facebook Native app not in safari browser on iphone device with ios 6.0
Hello I am using FBSession to open login view it opens Safari for login in iOS5.0 and ios 6.0 Simulator but in ios 6.0 iPhone it is opening Facebook APP not safari.Please tell me what is reason and how can I solve it?Here is my code for Facebook login. 您好,我正在使用FBSession打开登录视图,它在iOS5.0和ios 6.0 Simulator中打开了Safari进行登录,但是在ios 6.0 iPhone中,它正在打开不是野生动物园的Facebook APP。请告诉我这是什么原因,怎么解决?我的Facebook登录代码。
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
return [FBSession openActiveSessionWithReadPermissions:nil
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
[self sessionStateChanged:session
state:state
error:error];
}];
}
/*
* Callback for session changes.
*/
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
switch (state) {
case FBSessionStateOpen:
if (!error) {
// We have a valid session
NSLog(@"User session found");
if ([[IntegrationManager sharedInstance] facebookDidLogin:nil]) {
[self.window.rootViewController dismissModalViewControllerAnimated:YES];
};
}
break;
case FBSessionStateClosed:NSLog(@"Fbsession close");
case FBSessionStateClosedLoginFailed:
[FBSession.activeSession closeAndClearTokenInformation];
break;
default:
break;
}
[[NSNotificationCenter defaultCenter]
postNotificationName:FBSessionStateChangedNotification
object:session];
if (error) {
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Error"
message:error.localizedDescription
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}
For the user convenience the facebook app is started instead of the opening a website. 为了用户方便,启动了Facebook应用程序,而不是打开网站。 It is done so the user does not have to login in again, it is also known as single sign on.
这样做是为了使用户不必再次登录,这也称为单点登录。
If you are using the Facebook iOS SDK there is nothing you can do about or should do about it. 如果您使用的是Facebook iOS SDK,那么您将无能为力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.