更新iOS 9和Facebook sdk 4.6后,登录窗口无法打开

编程入门 行业动态 更新时间:2024-10-27 03:40:18
本文介绍了更新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后,登录窗口无法打开

本文发布于:2023-10-24 03:00:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1522745.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法打开   窗口   Facebook   iOS   sdk

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!