Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 无法在ios6中获取facebook访问令牌_Objective C_Facebook_Ios6_Facebook Social Plugins - Fatal编程技术网

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

Objective c 无法在ios6中获取facebook访问令牌,objective-c,facebook,ios6,facebook-social-plugins,Objective C,Facebook,Ios6,Facebook Social Plugins,在iOS6中,我在这里发布消息时使用了ACAccountType和SlRequest,但d=为此,我需要检索一些操作的访问令牌 下面是我用来获取数据的代码 ACAccountType *FBaccountType= [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; // Specify App ID and permissions NS

在iOS6中,我在这里发布消息时使用了
ACAccountType和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] 目标 5] 性质 6] 母帐户


如何使用ios6中的上述代码获取访问令牌?更新的Facebook SDK 3.1.1库修复了此问题