更新iOS 9和Facebook sdk 4.6后,登录窗口无法打开 [英] After update iOS 9 and Facebook sdk 4.6 the login window not open

查看:89
本文介绍了更新iOS 9和Facebook sdk 4.6后,登录窗口无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Xcode更新为7,将Facebook更新为4.6 SDK.

I update my Xcode to 7 , and Facebook to 4.6 sdk.

这是我的警告:

Warning: Attempt to present <FBSDKContainerViewController: 0x159337700> on <UIAlertController: 0x159262700> whose view is not in the window hierarchy!

在我的项目中,BitCode为否-因为如果将其设置为是",则会出现此错误:

in My project the BitCode is NO - because if I turn it to Yes I got this Error :

ld:'/Users/MyName/Desktop/MyProjectName/ProjectName/ProjectName/Resources/Frameworks/Fabric.framework/Fabric(Fabric.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是解析方法:

-(void)signInWithFacebookClicked
{
NSArray *permissions = [NSArray arrayWithObjects:@"email",@"user_friends", nil];
[PFFacebookUtils logInInBackgroundWithReadPermissions:permissions block:^(PFUser *user, NSError *error)
 {
     if (!user) // The user cancelled the Facebook login
     {
         NSLog(@"Uh oh. The user cancelled the Facebook login.");
     }
     else if (user.isNew) // New user (not stored on DB) - User signed up and logged in through Facebook
     {
         [self handleNewUser];
     }
     else if (user) // the user is exist at DB
     {
       // the user is exist at DB  
     }
     else if (error)
     {
        // showAlertOfSomethingWentWrong
     }
 }];
}

这是FBSDKGraphRequest:

this is FBSDKGraphRequest :

-(void)handleNewUser
{

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields": @"friends, first_name, gender, last_name, link, name, verified, picture, email"}];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error)
 {
     NSMutableDictionary *userData = (NSMutableDictionary *)result;
}];

我的问题是那条线:

[PFFacebookUtils logInInBackgroundWithReadPermissions:permissions block:^(PFUser *user, NSError *error)

运行永远不会进入iPhone的这个程序段,在模拟器中可以正常工作.

the run never go into this block in iPhone , in simulator this work fine.

推荐答案

我有一个类似的问题,我试图在FBSDKContainerViewController顶部显示登录警报.

I had a similar problem where I was trying to show a login alert on top of FBSDKContainerViewController.

在此次通话中

- (void)logInWithReadPermissions:(NSArray *)permissions
          fromViewController:(UIViewController *)fromViewController
                     handler:(FBSDKLoginManagerRequestTokenHandler)handler;

Facebook提供了自己的视图控制器,如果您未指定fromViewController,则将自动确定最顶部的视图控制器".

Facebook presents its own view controller and if you don't specify the fromViewController, "the topmost view controller will be automatically determined as best as possible."

就您而言,听起来好像Facebook试图在被关闭的警报之上显示,即使这不是正在调用的呼叫.

In your case, it sounds like Facebook is trying to present on top of an alert that was dismissed, even if this is not the call being invoked.

这篇关于更新iOS 9和Facebook sdk 4.6后,登录窗口无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆