Reputation: 3
I am using facebook account kit for the first time for phone/email verification in my web app. I have followed https://developers.facebook.com/docs/accountkit/webjs for integration and it is working fine. Buy the only issue is the phone number that I send to account kit is editable in account kit popup.So how can know which phone number is used for verification.I don't see any information related to it in documentation or in response that I got in callback.
Is there a way to disable input box in account kit popup, so that I can be confident that the authentication response I get from account kit is related to same phone number that I sent? Or is there a way to get phone number that is used for verification as part of response from account kit?
Facing same issue with email verification aswell.
Upvotes: 0
Views: 2040
Reputation: 1
You can send a number through the parameter "state"
AccountKit_OnInteractive = function(){
AccountKit.init(
{
appId:"APP_ID",
state:document.getElementById("phone").value;//HERE YOU PUT YOUR NUMBER, you can hash it if you want
version:"v1.1",
fbAppEventsEnabled:true,
redirect:"URL,
}
);
};
IN RESPONSE you will get it
function loginCallback(response) {
var phoneNumber = response.state //HERE GET IT
})
Upvotes: 0
Reputation: 361
At the end of the Account Kit flow, you (the developer) get the phone number that was verified. If you pass an initial phone number, or you're on Android and have READ_PHONE_STATE and the SIM phone number is populated, the person going through the flow might edit it since they might want to use a different phone number. But then one returned to you (the developer) at the end of the experience is the one that was confirmed.
See the phone number extraction toward the end of the documentation here: https://developers.facebook.com/docs/accountkit/webjs
Upvotes: 0