首页 > 解决方案 > Facebook 的 JS SDK 停止在控制台中处理此错误

问题描述

我正在使用加载站点的 android studio 完成一个 webview 项目......当突然从 facebook 的登录按钮停止工作并且此错误出现在控制台中时,一切工作正常: 在此处输入图像描述

登录脚本:

  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 错误,或者我还缺少什么?

标签: javascriptfacebook-graph-apisdkfacebook-login

解决方案


最近有一个错误报告,https://developers.facebook.com/support/bugs/378853882892232/ - 但根据该报告的评论,现在问题似乎已经解决。

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


推荐阅读