gpt4 book ai didi

ios - Facebook iOS : requestNewPublishPermissions not asking user for new authority

转载 作者:可可西里 更新时间:2023-11-01 05:53:39 24 4
gpt4 key购买 nike

我在使用 requestNewPublishPermissions 时遇到问题(我使用的是 SDK 3.17 版)。 Facebook 文档说只使用读取权限登录,然后再请求写入权限,这就是我想要做的。我可以让用户使用这样的代码登录:

[FBSession openActiveSessionWithReadPermissions:@[@"public_profile"]
allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState state, NSError *error)
{
// Handler for session state changes
// This method will be called EACH time the session state changes,
// also for intermediate states and NOT just when the session open
[self sessionStateChanged:session state:state error:error];
}];

然后当我想发布到时间线时,我要求使用下面的代码扩展权限。该应用程序通过 Facebook 网页启动到 Safari。但是该网页并没有请求写权限,而是说该应用程序已经获得了权限。然后当我点击确定,控制权返回到应用程序时,我没有发布权限。看到“这就是它结束的地方!”下面。

我尝试访问 facebook.com 并删除“应用程序”下已授予的权限。那没有任何区别。无论如何,我也尝试过发布,但这给了我一个错误,提示我没有正确的权限。

有什么想法吗?

- (void) requestPublishPermission:(void (^)(void)) action
{
// Request publish_actions
[FBSession.activeSession requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_actions"]
defaultAudience:FBSessionDefaultAudienceFriends
completionHandler:^(FBSession *session, NSError *error)
{
if (!error)
{
if ( [FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound )
{
// this is where it ends up!
}
else
{
// Permission granted, publish the story
action();
}
}
else
{
// permission denied, alert user
}
}];
}

最佳答案

您需要将您正在登录的用户添加为开发人员/测试人员。或者您需要将您的应用提交给 Facebook 进行审核。

关于ios - Facebook iOS : requestNewPublishPermissions not asking user for new authority,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25294444/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com