1

在帐户工具包弹出窗口中输入手机号码后,它告诉我很抱歉,出了点问题。我得到:

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 开发者仪表板中的应用程序/帐户工具包:

在此处输入图像描述

4

0 回答 0