1

这是我使用 facebook 登录的代码:

   if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
        {
            ACAccountStore *accountStore = [[ACAccountStore alloc] init];
            ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
            NSDictionary *options = @{ACFacebookAppIdKey : FACEBOOK_APP_ID,
                                      ACFacebookPermissionsKey : @[@"public_profile"]
                                      };
            [accountStore requestAccessToAccountsWithType:accountType
                                                  options:options
                                               completion:^(BOOL granted, NSError *error)
             {

                 if(granted)
                 {
    }
                 else
                 {
                     NSLog(@"%@", [error description]);
    }
             }]; 
}

当我尝试在 iOS 9.2.1 中使用 facebook 登录时,“granted”参数总是变为 false。我已经尝试过其他版本,例如 iOS 9.2 和 iOS 9.1,它运行良好

我在堆栈和谷歌中进行了很多研发,但无法找到合适的解决方案。

您的帮助将不胜感激。

谢谢。

4

0 回答 0