如您所见,在下面的屏幕截图中,我已修改了info.plist,但仍无法使本地应用程序切换工作。
我还仔细检查了info.plist值的拼写错误。我可以保证它们是正确的。
这是我的代码:-
if (![AppDelegate SharedInstance].login) {
[AppDelegate SharedInstance].login = [[FBSDKLoginManager alloc] init];
}
[AppDelegate SharedInstance].login.loginBehavior = FBSDKLoginBehaviorNative;
[[AppDelegate SharedInstance].login logInWithReadPermissions:@[@"public_profile",@"email",@"user_friends"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
}
else if (result.isCancelled)
{
// Handle cancellations
}
else
{
NSLog(@"result.grantedPermissions == %@",result.grantedPermissions);
if (result.token)
{
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields": @"id, name, email, first_name, last_name"}]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@", result);
NSString *userImageURL = [NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large", [result objectForKey:@"id"]];
[dictFacebookDetail addEntriesFromDictionary:result];
[dictFacebookDetail setObject:userImageURL forKey:@"profilepic"];
NSLog(@"facebook login result --- %@",dictFacebookDetail);
[self performSelectorInBackground:@selector(CheckFacebookUser:) withObject:dictFacebookDetail];
}
}];
}
}
}];
我错过了什么?