无法在ios6中获取facebook访问令牌

时间:2012-10-16 07:26:00

标签: objective-c facebook ios6 facebook-social-plugins

在iOS6中发布消息我在这里使用ACAccountType and SlRequest但d =为此我需要为某些操作检索访问令牌,

以下是我用于获取数据的代码

ACAccountType *FBaccountType= [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

            // Specify App ID and permissions
        NSDictionary *dictFB = @{
    ACFacebookAppIdKey:kAppId,
    ACFacebookPermissionsKey: @[@"email",@"publish_stream", @"publish_actions"],
    ACFacebookAudienceKey: ACFacebookAudienceFriends
        };

    [accountStore requestAccessToAccountsWithType:FBaccountType options:dictFB completion:
     ^(BOOL granted, NSError *e) {
         if (granted) {
             NSArray *accounts = [accountStore accountsWithAccountType:FBaccountType];
//              it will always be the last object with single sign on
             facebookAccount = [accounts lastObject];
             NSLog(@"facebook account = %@",facebookAccount);

         } else {
                 //Fail gracefully...
             NSLog(@"error getting permission %@",e);
         }
     }];

但是从上面的代码我只得到以下数据 1]类型 2]帐户说明 3]用户名 4]的objectid 5]属性 6]父帐户

如何使用ios6中的上述代码获取访问令牌

1 个答案:

答案 0 :(得分:0)

此问题已由更新的Facebook SDK 3.1.1库修复