Roe*_*dam 6 objective-c facebook-sdk-4.0 ios9
我将我的Xcode更新为7,将Facebook更新为4.6 sdk.
这是我的警告:
Warning: Attempt to present <FBSDKContainerViewController: 0x159337700> on <UIAlertController: 0x159262700> whose view is not in the window hierarchy!
Run Code Online (Sandbox Code Playgroud)
在我的项目中BitCode是NO - 因为如果我把它变为是,我得到了这个错误:
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)
Run Code Online (Sandbox Code Playgroud)
这是解析方法:
-(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
}
}];
}
Run Code Online (Sandbox Code Playgroud)
这是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;
}];
Run Code Online (Sandbox Code Playgroud)
我的问题是那条线:
[PFFacebookUtils logInInBackgroundWithReadPermissions:permissions block:^(PFUser *user, NSError *error)
Run Code Online (Sandbox Code Playgroud)
运行永远不会进入iPhone的这个块,在模拟器中这个工作正常.
| 归档时间: |
|
| 查看次数: |
3615 次 |
| 最近记录: |