简体   繁体   English

在未使用ios 6.0的iPhone设备上的Safari浏览器中,Facebook登录是在Facebook本机应用程序中打开的

[英]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.

相关问题 IOS中的Facebook登录可以在模拟器上运行,但不能在安装了本机应用程序的设备上运行 - Facebook login in IOS works on emulator but not on device with native app installed Facebook 在应用程序内实现(无需在 safari 或本机应用程序中打开) - Facebook Implementation within app (without opening in safari or native app) Facebook登录iPhone应用程序 - Facebook login on iPhone app 在ios应用程序中使用facebook应用程序登录显示safari中的选项“使用Facebook应用程序登录”并且它在ios 10.1中无效 - Login with facebook app in ios app shows option in safari “Login with Facebook app” and its not working in ios 10.1 Facebook iphone 版本作为 iOS 上 safari 之外的应用程序? - Facebook iphone-version as app outside safari on iOS? Facebook登录可在iPhone模拟器上使用,但不能在iPhone设备上使用 - facebook login works on iphone simulator but not on iphone device 我们可以强制在浏览器中而不在本机应用程序iphone中打开Facebook链接吗 - can we force to open facebook link in browser not in native app iphone iphone facebook登录safari无法打开页面 - iphone facebook login safari cannot open the page Facebook iPhone应用程序登录效果 - Facebook iPhone app login effect 如何在iOS6 iPhone App中使用Facebook或Twitter创建登录 - How to create Login with Facebook or twitter in ios6 iphone App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM