当在帐户工具包弹出窗口输入手机号码后,它告诉我,我们很抱歉,出了点问题。我得到了:
response.status = NOT_AUTHENTICATED
代码:: -
<div onclick="phone_btn_onclick();" class="btn btn-info text-center">Verify mobile number
</div>
<script>
var mobile_veri=false;
// initialize Account Kit with CSRF protection
AccountKit_OnInteractive = function(){
AccountKit.init(
{
appId:1066226316760891,
state:"abcd",
version:"v1.0"
}
);
};
function loginCallback(response) {
console.log(response);
if (response.status === "PARTIALLY_AUTHENTICATED") {
mobile_veri=true;
}
else if (response.status === "NOT_AUTHENTICATED") {
// handle authentication failure
console.log("Authentication failure");
}
else if (response.status === "BAD_PARAMS") {
// handle bad parameters
console.log("Bad parameters");
}
}
function phone_btn_onclick() {
var country_code = document.getElementById("country_code").value;
var ph_num = document.getElementById("phone_num").value;
AccountKit.login('PHONE',
{countryCode: country_code,phoneNumber: ph_num}, // will use default values if this is not specified
loginCallback);
}
function email_btn_onclick() {
// you can add emailAddress to set value
AccountKit.login('EMAIL', {}, loginCallback);
}
// destroying session
function logout() {
document.location = '/logout';
}
</script>
帐户套件JAVASCRIPT代码:
我的Facebook开发人员信息中心中的应用/帐户套件: