Getting phone number from Facebook Account Kit

前端 未结 4 1181
暗喜
暗喜 2021-02-06 07:25

The Account Kit documentation states that if your began the login session with AccountKitActivity.ResponseType.TOKEN, it\'s possible to access the Account Kit ID, phone number a

4条回答
  •  难免孤独
    2021-02-06 07:41

    If you have access code/token...

    On server or client, you can exchange access token for mobile number and country code with this FB AccountKit API - https://graph.accountkit.com/v1.1/me/?access_token=xxxxxxxxxxxx. Here xxxxxxxxxx is your Access Token.

    If you have auth code/token instead...

    You can first exchange the access code for an access token on the server side (because it contains the App Secret) with this API - https://graph.accountkit.com/v1.1/access_token?grant_type=authorization_code&code=xxxxxxxxxx&access_token=AA|yyyyyyyyyy|zzzzzzzzzz. Here xxxxxxxxxx, yyyyyyyyyy and zzzzzzzzzz are the auth code, app id and app secret respectively. Once you have the access token with it, you can get the mobile number with the above mentioned API.

    Good Luck.

提交回复
热议问题