Getting proxy email address instead of real email address for a user with facebook sdk on android
I am developing an android app which has Facebook integration in it. I have correctly created a Facebook App & added my debug key-store's hash code in App settings.
I can log-in into Facebook successfully and get basic information about the logged in user correctly. I am using the official Facebook SDK for android.
I have asked user for permission of email address only. This was working as of yesterday. I was getting email address correctly. But from today it's giving me proxied email address开发者_JS百科 instead of real email address.
In the permission dialog where it asks for allowing, it's showing me correct (real) email address, but when I query a graph API call ('me'), it gives me proxied email address.
Has anybody encountered this issue?
Here is a screenshot of the permission dialog.
I have tried with different key hashes, creating a new Facebook app, creating a new Facebook account. The same behavior is also happening on iPhone version of our app.
EDIT-> After looking into the Account Settings Page > Apps on Facebook, the permissions I have requested is 'email' but on App Settings it's only showing permission for proxy email address. How can I request permission for real email address? Has Facebook recently changed their Permission model?
EDIT 2 -> I tried the new Hackbook for Android example included in Facebook Android SDK. It didn't had 'email' permission added, so I just modified that in the example and even that example is getting proxy email address now!! :( So it's certainly not my code's problem.
I had the same issue. After extensive debugging, what I found was that in the Facebook App setings, disabling "Enhanced Auth Dialog" did the trick. That can be found in your App settings under Advanced.
Your milage may vary.
I was having a similar issue (proxied email exposed via web app, not Android app) but couldn't find much in terms of documentation. Best I could tell, it had to be something to do with legacy permissions for the user.
This post (from January 2010) describes the shift from proxy to real email handles. My thinking went "if a user gave your app permissions before the shift, FB must still have a bit set somewhere so that your app can only get the proxied handle."
I discovered a recent FB blogpost about the revoking old permissions.
Here's a synopsis of my JS code (included after FB.init) to revoke the 'email' permission when prompting users to login (at which point they'll be prompted for the 'email' permission again):
FB.Event.subscribe('auth.prompt',
function(response) {
FB.api('/me/permissions', 'delete', { permission : 'email' }, function(response) {
// do something here if you like
});
}
);
I know that doesn't exactly solve your problem, but hopefully it will point you in the right direction for the language you're using.
精彩评论