iOS Facebook SDK 3.1登录时添加权限 [英] iOS Facebook SDK 3.1 add permission when login

查看:95
本文介绍了iOS Facebook SDK 3.1登录时添加权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循Facebook SDK 3.1教程:出色并将FB集成到我的应用程序中.

I am trying to follow the Facebook SDK 3.1 tutorial: Scrumptious and integrate FB to my app.

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {

NSArray *permissions = @[@"email"];

return [FBSession openActiveSessionWithReadPermissions:permissions
                                          allowLoginUI:allowLoginUI
                                     completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                         [self sessionStateChanged:session state:state error:error];
                                     }];

我想添加额外的权限,但是它仅在身份验证中显示基本信息,如下图所示:

I want to add extra permission however it only show the basic information in the authentication as the following image:

我还使用了不赞成使用的方法,并且得到了相同的结果:

I also used deprecated method and I got the same result:

[FBSession openActiveSessionWithPermissions:permissions allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
    [self sessionStateChanged:session state:state error:error];
}];

我从此处在其他地方使用reauthorizeWithPublishPermissions.用户必须登录Facebook两次才能阅读用户电子邮件.

I found temporary solution from here by using reauthorizeWithPublishPermissions in somewhere else. The user have to login to the facebook twice to read the user email.

有什么解决方案可以一次完成吗?

Is there any solution which I can do it in once?

感谢您的帮助!

使用openActiveSessionWithPublishPermissions在stackoverflow上的另一个帖子 ,其结果仍与屏幕截图相同.

Another post on stackoverflow, using openActiveSessionWithPublishPermissions, still have the same result as the screenshot.

推荐答案

我会在Facebook应用程序的权限设置中检查Facebook.com上的权限,并确保它们匹配.我确实相信他们说您可以在iOS代码中设置权限,但是我建议也将FB应用程序设置中的权限匹配.

I would check the permissions on Facebook.com in the Facebook app's permission settings and make sure they match. I do believe they say you can set the permissions in your iOS code, but I would recommend matching the permissions in the FB app settings as well.

这篇关于iOS Facebook SDK 3.1登录时添加权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆