来自Facebook的JS SDK停止在控制台中处理此错误

时间:2019-01-23 23:19:23

标签: javascript facebook-graph-api sdk facebook-login

我正在用加载了网站的android studio完成一个webview项目...突然从Facebook登录按钮停止工作并且此错误出现在控制台中时,一切正常。 enter image description here

登录脚本:

  function statusChangeCallback(response) {
console.log('1');

    if (response.status === 'connected') {
      // Logged into your app and Facebook.

      testAPI();
    } else {

    }
  }

  function checkLoginState() {
    console.log('2');

    FB.getLoginStatus(function(response) {
      statusChangeCallback(response);
    });
  }

  window.fbAsyncInit = function() {
    console.log('3');
    FB.init({
      appId      : '00000',
      cookie     : true,  // enable cookies to allow the server to access 
                          // the session
      xfbml      : true,  // parse social plugins on this page
      version    : 'v3.2'
    });



  };

  // Load the SDK asynchronously
  (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "https://connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));

  function testAPI() {

    FB.api('/me?fields=email,name,first_name,last_name,gender',
    function(response) {


      $.ajax({
        url: "loginSave.php",
        type: "post",
        data: {id:response.id,
          email:response.email,
          name1:response.name,
          name2:'',
          gender:response.gender} ,
        success: function (response) {
           window.location.href = 'principal.php';
        },
        error: function(jqXHR, textStatus, errorThrown) {
         //  console.log(textStatus, errorThrown);
        }
    });


    });
  }

她的图书馆是否存在Facebook错误,或者我还缺少其他东西?

1 个答案:

答案 0 :(得分:0)

最近有关于此问题的错误报告https://developers.facebook.com/support/bugs/378853882892232/-根据该报告的评论,看来该问题现在已经解决。

如果您仍然遇到此问题,请提交一份新报告(并可能提及其中的现有报告-该报告已经关闭,因此如果您对此发表评论,则可能会被忽略。)