简体   繁体   English

iOS上的Facebook AccessToken无权访问电子邮件权限

[英]Facebook AccessToken from iOS doesn't have access to email permission

My app supports Facebook login and will be released to Apple Appstore real soon. 我的应用程序支持Facebook登录,并将很快发布到Apple Appstore。 I was testing the Facebook login for a while and it seemed to work all the time until now. 我测试了一段时间的Facebook登录名,直到现在似乎一直都在工作。 When I login, the access token return by Facebook does not have email as one of the permission and I do need email for registering with my app. 当我登录时,Facebook返回的访问令牌没有电子邮件作为许可之一,我确实需要电子邮件来注册我的应用程序。 On developer.facebook.com under settings for my app, I have the following setup 在developer.facebook.com上我的应用设置下,我进行了以下设置

 User & Friend Permissions: email user_about_me user_birthday
 Extended Permissions: read_friendlists

I also got the accessToken from my device and used https://developers.facebook.com/tools/debug/ and pasted my access token in there but it doesn't have email as one of the scope (the only scope listed is user_friends). 我还从设备中获取了accessToken,并使用https://developers.facebook.com/tools/debug/并将我的访问令牌粘贴到其中,但是其中没有电子邮件作为范围之一(列出的唯一范围是user_friends )。

The app on Facebook is set to live (non-sandbox) so everyone can access it. Facebook上的应用已设置为可运行(非沙盒),因此每个人都可以访问它。 Also on iOS, I do not have my app listed under Settings->Privacy->Facebook even after I give my app access to Facebook by successfully signed into Facebook. 同样在iOS上,即使我通过成功登录Facebook授予应用访问Facebook的权限,我的应用也没有在“设置”->“隐私”->“ Facebook”下列出。 When I press login with Facebook, it opens Facebook website and says the following "'My App' will receive the following info: your public profile and friend list." 当我按Facebook登录时,它将打开Facebook网站并显示以下“我的应用程序”将收到以下信息:您的公开个人资料和朋友列表。 and it doesn't mention email in there. 而且它没有提及电子邮件。

I have removed Facebook app from iOS, logged out of Facebook account from iOS settings, restarted the device and also removed my app and installed again and nothing seems to be working for iOS. 我已经从iOS中删除了Facebook应用程序,从iOS设置中注销了Facebook帐户,重新启动了设备,还删除了我的应用程序并再次安装,但似乎没有适用于iOS的功能。 We do have an Android version of our app, and that is working (able to get email) without any problem. 我们的应用程序确实有一个Android版本,并且可以正常运行(能够接收电子邮件),没有任何问题。

Any help is appreciated. 任何帮助表示赞赏。

Edited: 编辑:

Also on Facebook it says that my app accessed email (for my profile) on Oct 25th. 同样在Facebook上,它说我的应用程序于10月25日访问了电子邮件(针对我的个人资料)。 So it was able to access email on that day. 这样它就可以在当天访问电子邮件。

However you are requesting the login you have to manually request the e-mail on top of basic permissions. 但是,您要登录时必须在基本权限之上手动请求电子邮件。 You do so by putting under the readPermissions an array that contains the string email, like so... 为此,您可以在readPermissions下放置一个包含字符串email的数组,如下所示:

fbLoginView.readPermissions = @[@"email"]

Or in openActiveSessionWithReadPermissions:allowLoginUI:completionHandler put the first argument as @[@"email"] . 或在openActiveSessionWithReadPermissions:allowLoginUI:completionHandler将第一个参数作为@[@"email"]

Weirdly, I've found that the app permissions do not often correlate the permissions that the app grabs. 奇怪的是,我发现应用程序权限通常不与应用程序所获取的权限相关。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM