English 中文(简体)
Facebook SDK :有时通过电子邮件将外地返回无效(通过“电子邮件”许可确定)
原标题:Facebook SDK : sometimes email field return null ( with "email" permission set )
  • 时间:2012-04-14 15:11:49
  •  标签:
  • facebook

我在PHP中有一份Facebook App。 供用户使用“电子邮件”许可。 我注意到,我获得了用户电子邮件地址90%,但不是某些。

我知道,电子邮件许可使Facebook App得以获得用户简介中载明的主要电子邮件地址,但SDK有时返回<代码>null?

最佳回答

“电子邮件”是允许用户在提出申请时不必给予的延伸许可。 如果您需要用户在您的传阅之前给予“电子邮件”许可,那么你必须检查,在允许用户在认证后继续工作之前,这种许可在场。

页: 1

Here is a method that I use to do just that:

<代码>permissions is a range of strings which represent the granteds requested.

hasPermissions(["email"], function(hasPerms){
     alert(hasPerms);
 });

function hasPermissions(permissions, callback){
    console.log("perms requested");
    console.log(permissions);
    FB.api("/me/permissions", function(response){
        var hasPerms = true;
        console.log("perms obtaind");
        console.log(response);
        for(var i in permissions){
            console.log([permissions[i]] + " - " + response["data"][0][permissions[i]])
            hasPerms = hasPerms && response["data"][0][permissions[i]] == 1;
        }
        if(typeof callback == "function"){
            callback(hasPerms);     
        }       
    });
}
问题回答

I dont think email is part of extended permission set. I asked for the email permission in the authorization dialog, it does not appear in the auth dialog.





相关问题
Facebook Connect login dialog not working

I am using Facebook Connect for iPhone and following the official instructions. I use the following code to display the login dialog: FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:...

Facebook App Profile Tab is Empty ... No Content Displayed?

I can view my application via the http://apps.facebook.com/myapplication/ link and the content shows up correctly. I also added the application as a tab to a facebook page. However, when viewing the ...

Facebook Platform error: "Object cannot be liked"

I m working on a Facebook Application that generates wall posts. In testing these posts, I ve discovered that the Facebook Platform action of "liking" a post is failing. The specific error message ...

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php include_once ./facebook-platform/php/facebook.php ; $facebook = new Facebook(my ...

Facebook connect

If I plug in the facebook connect into my website, How can I prevent double signups? Lets say I have a user that s already signed up to my site but he clicked the connect with facebook, is there a ...

热门标签