简体   繁体   English

Facebook权限 - com.apple.accounts错误8

[英]Facebook permission - com.apple.accounts error 8

I need to publish status on Facebook timeline. 我需要在Facebook时间线上发布状态。 My code consists 2 request. 我的代码包含2个请求。 First for verifying email permission, second for verifying publish permission. 首先用于验证电子邮件权限,第二个用于验证发布权限。 I get successful response with permission "email" request but I get error "Publish permission error: The operation couldn't be completed. (com.apple.accounts error 8.)" in second case. 我通过权限“电子邮件”请求获得成功响应但我收到错误“发布权限错误:操作无法完成。(com.apple.accounts错误8.)”在第二种情况下。 Do you have any ideas where could be error? 你有什么想法可能会出错吗? Thanks for help. 感谢帮助。

- (void)facebookStatus:(NSString *)identifier {
ACAccountStore *accountStore = [[ACAccountStore alloc]init];

ACAccountType *FBaccountType= [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

NSString *key = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FacebookAppID"];
NSDictionary *options = @{
                          ACFacebookAppIdKey : key,
                          ACFacebookPermissionsKey : @[@"email"]
                          };

[accountStore requestAccessToAccountsWithType:FBaccountType options:options completion:^(BOOL granted, NSError *error) {
     if (granted) {
         NSArray *accounts = [accountStore accountsWithAccountType:FBaccountType];

         if ([accounts count] > 0) {
             ACAccountStore *accountStore = [[ACAccountStore alloc]init];
             ACAccountType *FBaccountType= [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
             NSString *key = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FacebookAppID"];
             NSDictionary *options = @{
                                       ACFacebookAppIdKey : key,
                                       ACFacebookPermissionsKey : @[@"publish_stream"]
                                       };

             [accountStore requestAccessToAccountsWithType:FBaccountType options:options completion:^(BOOL granted2, NSError *error) {
                  if (granted2) {
                      NSLog(@"Publish")
                      ;                          
                  }
                  else {
                      NSLog(@"Publish permission error: %@", [error localizedDescription]);
                      //_publishPermissionsGranted = NO;
                  }

              }];
         }
     }
     else NSLog(@"Nope");

    if (error) {
        if (error.code == 6) {
            NSLog(@"FB Account doesn't exist");
        }
        NSLog(@"Error: %@", error.localizedDescription);
    }
 }];
}

Okey, I've got it! 哦,我知道了! Options dictionary has to look like this: 选项字典必须如下所示:

NSDictionary *options = @{
                                       ACFacebookAppIdKey : key,
                                       ACFacebookPermissionsKey : @[@"publish_stream", @"publish_actions"],
                                       ACFacebookAudienceKey: ACFacebookAudienceEveryone
                                       };

Instead of this: 而不是这个:

NSDictionary *options = @{
                                   ACFacebookAppIdKey : key,
                                   ACFacebookPermissionsKey : @[@"publish_stream"]
                                   };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Twitter操作无法完成。 (com.apple.accounts错误6。)? - Twitter The operation couldn’t be completed. (com.apple.accounts error 6.)? AX 查找问题 - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:xxxx - AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:xxxx 错误Domain = com.apple.healthkit代码= 5 - Error Domain=com.apple.healthkit Code=5 插件com.apple.share.Facebook.post无效 - plugin com.apple.share.Facebook.post invalidated 应用内购买。 没有验证插件来验证 com.apple.account.iTunesStore.sandbox 类型帐户的凭据 - InApp Purchases. No auth plugin to verify credentials for accounts of type com.apple.account.iTunesStore.sandbox 在Facebook中获取此错误(com.facebook.error.2) - Getting this error in facebook (com.facebook.error.2 ) iOS App Store提交:Apple是否使用经过验证的Facebook帐户测试Facebook应用程序? - iOS App Store Submission: Does Apple Test Facebook Apps with verified Facebook Accounts? iOS6中的Facebook集成错误(Accounts.framework) - Facebook Integration Error ( Accounts.framework) in iOS6 CallKit 错误 com.apple.CallKit.error.requesttransaction 错误 7 - CallKit error com.apple.CallKit.error.requesttransaction error 7 CallKit 错误 com.apple.CallKit.error.requesttransaction 错误 2 - CallKit error com.apple.CallKit.error.requesttransaction error 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM