为什么requestAccessToAccountsWithType facebook失败并显示“无效权限:photo_upload”

时间:2014-08-05 15:01:37

标签: ios facebook facebook-graph-api slrequest

我正在尝试访问Facebook,以便将图像发布到iOS应用中的页面。但到目前为止,我甚至不能让它给我所需的权限。

我已经做了很多搜索,包括iOS 6 Facebook posting procedure ends up with "remote_app_id does not match stored id" errorFacebook Graph Api Fan page photo upload (IOS),但这些或其他帖子都没有解决此问题。

以下是代码的auth位:

ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

NSDictionary *options = @{
                          ACFacebookAppIdKey: @"xxxxxxxxxxxxxx",
                         ACFacebookPermissionsKey: @[@"manage_pages"],
                          ACFacebookAudienceKey: ACFacebookAudienceEveryone
                          };

[accountStore requestAccessToAccountsWithType:accountType options:options completion:^(BOOL granted, NSError *error)
 {
     if (granted)
     {
         NSDictionary *options = @{
                                   ACFacebookAppIdKey: @"xxxxxxxxxxxxxx",
                                   ACFacebookPermissionsKey: @[@"photo_upload"],
                                   ACFacebookAudienceKey: ACFacebookAudienceEveryone
                                   };

         [accountStore requestAccessToAccountsWithType:accountType options:options completion:^(BOOL granted, NSError *error)
          {
              if (granted)
              {
                   // then do the upload - but it never gets here
              }
              else
              {
                   // handle error - this is where it ends up
              }
          }];
     }
     else
     {
          // handle error
     }
 }];

正如在其他一些帖子上建议的那样,我在写入之前首先请求读取权限。它获得了manage_pages权限。

当我要求获得photo_upload权限时,会弹出Facebook权限提醒,要求我确认它可以代表我发布,然后单击“确定” - 但该权限请求块将以授予的设置返回为FALSE。

我在那时得到的完整错误消息是" Facebook服务器无法满足此访问请求:无效权限:photo_upload"

在Facebook应用程序网站上,我认为我已经做了我需要做的所有事情:我创建了我的应用程序并获得了一个AppId,添加了iOS作为平台并将BundleId设置为iOS应用程序使用的同一个,并且高级选项卡将其设置为Native应用程序。

有没有人知道我做错了什么?

1 个答案:

答案 0 :(得分:0)

使用publish_actions作为您的许可。新的Facebook API建议在适用时使用publish_actions代替publish_stream。如果您要将以下功能发布到朋友的供稿,发布问题,创建便笺以及将内容发布到活动或群组,则应包括publish_stream

相关问题