Facebook JS SDK not loading on Safari Mobile (usin

2019-07-09 03:54发布

问题:

I am developing a Facebook App using JS SDK. Everything works fine on FF/Chrome/Safari, except on iPad where the SDK just won't load.

I tried it by using very simple code (most of it coming directly from Facebook's documentation), like that:

<!doctype html>
<html>
<head>

</head>
<body>
    <div id="fb-root"></div>
    <script src="//connect.facebook.net/en_US/all.js"></script>
    <script>


        /* All Facebook functions should be included 
        in this function, or at least initiated from here */


        window.fbAsyncInit = function() {




            FB.init({appId: MYAPPID, 
  status     : true, // check login status
  cookie     : true, // enable cookies to allow the server to access the session
  xfbml      : true  // parse XFBML
});




            FB.login(function(response) {
                if (response.authResponse) {
                    console.log('Welcome!  Fetching your information.... ');
                    FB.api('/me', function(response) {
                        console.log('Good to see you, ' + response.name + '.');


                    });
                } else {
                    console.log('User cancelled login or did not fully authorize.');
                }
            });

        };




        (function() {
            var e = document.createElement('script'); e.async = true;
            e.src = document.location.protocol +
                '//connect.facebook.net/en_US/all.js';
            document.getElementById('fb-root').appendChild(e);
        }());




    </script>
</div>

And nothing shows up. No popup (they are not blocked), no console.log, nothing. Is it an issue with my code or is Facebook SDK going crazy today? I saw nothing relevant on the platform status.