iOS 的 Facebook 权限
由于某种原因,我在授权我的应用程序时不断获得“基本信息”的单一许可。这是我的代码:
- (void)login {
if (![facebook isSessionValid]) {
NSArray *permissions = [NSArray arrayWithObjects:@"offline_access",@"publish_stream",nil];
[facebook authorize:permissions];
}
}
有人可以帮我吗?我需要帖子权限和位置权限。
For some reason I am constantly getting a single permission of 'basic information' when authorizing my application. This is my code:
- (void)login {
if (![facebook isSessionValid]) {
NSArray *permissions = [NSArray arrayWithObjects:@"offline_access",@"publish_stream",nil];
[facebook authorize:permissions];
}
}
Can anyone help me out? I'm needing post permissions and location permissions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个,应该有效
Try this,It should work
我认为当您要求授权该应用程序时,不会提示“offline_access”权限。它所做的只是将有效期延长到比正常情况“长寿”。所以,在我看来,这并不是真正的请求许可。
我认为即使您发送空权限,发布权限也已被授予。我只需使用 [facebook Authorize:nil]; 即可发送提要。但是你将无法使用“消息”字段来获取零权限(Facebook 会忽略它)。为此,您需要“publish_stream”权限。
至于位置权限,您需要“user_location”来执行此操作。请参阅http://developers.facebook.com/docs/reference/api/permissions/< /a> 获取权限列表。
希望这有帮助:)
I think that "offline_access" permission is not prompted when you ask to authorize the app. All it does is just extend the expiration date to be "long-lived" than normal. So, imo, it is not really a permission to ask.
I think post permissions is already granted even you send an empty permission. I can send feeds by just using [facebook authorize:nil];. But you won't be able to use the "message" field for nil permission, (facebook will ignore it). For that you need "publish_stream" permission.
As for location permissions, you need "user_location" to do that. See http://developers.facebook.com/docs/reference/api/permissions/ for list of permissions.
Hope this helps :)