无法在iPhone 5上使用FBLogin视图登录

时间:2014-01-29 11:28:31

标签: ios iphone facebook facebook-login

我已经逐步从开发者页面使用Facebook登录流程创建了Facebook应用程序。登录效果很好。我的问题是这不适用于iPhone 5或5s。

我试过检查6种不同的iPhone 5,它只适用于其中一种。一旦我点击了"登录"我收到消息the app would like to access to you basic info一旦我点击"确定"我收到user cancel login错误或者"不允许"在警报中。没有任何反应。任何想法可能是什么问题?谢谢

iphone 5 and 5s problem

login and errors

this is how its open in all devices accept from iPhone 5 and 5s.

1 个答案:

答案 0 :(得分:1)

请尝试使用FBSession,而不是使用FBLoginView:

// no action can be done on facebook if there is no session on open state 
if (!FBSession.activeSession.isOpen) { 
   FBSession *session = [[FBSession alloc] initWithPermissions:@[@"email", @"user_birthday"]]; 
   [FBSession setActiveSession:session]; 

   // Here this behavior garantees that the iOS Login Dialog is not shown, because it was causing some login issues 
   // The fallback flow will be: 1- Facebook App Native Login Dialog; 2- Facebook App Web Login Dialog; 3- Mobile Safari Login Dialog 
   [[FBSession activeSession] openWithBehavior:FBSessionLoginBehaviorWithNoFallbackToWebView 
                             completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                  if(error) { // your code here }
                                  else { // your code here }
                             }}];