Facebook , How to get phone number after login with facebook sdk?

我怕爱的太早我们不能终老 提交于 2020-01-23 02:01:12

问题


I have integrated FB sdk for customer login and not able to get phone number in response. Here is my code

FB.api('/me',
    {fields: "id,email,first_name,gender,name,last_name,token_for_business"},
      function(response) {

    });

With that above code, I am getting all information expect phone number. I have passed extra parameter mobile_phone then getting undefined response. Here is code

FB.api('/me',
    {fields: "id,email,first_name,gender,name,last_name,token_for_business,mobile_phone"},
      function(response) {
      console.log(response.mobile_phone);
    }); 

I have tried with parameter "user_mobile_phone" also still getting undefined response only

Please help me to resolve this, thanks in advance.


回答1:


There is no way to get the phone number, those phone permissions do not exist.

There are other threads about this already, for example: Facebook API, Phone Numbers



来源:https://stackoverflow.com/questions/47901175/facebook-how-to-get-phone-number-after-login-with-facebook-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!