Für das Leben von mir kann ich Eventsubscribe ('auth.authResponseChange') nicht funktionieren. Siehe Code unterfacebook FB.Event.subscribe ('auth.authResponseChange') funktioniert nicht
<div id="fb-root">
</div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'XXXXXXXXXXXXXXX', // App ID
channelUrl: 'http://XXXXXXXX.us/', // Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
FB.Event.subscribe('auth.authResponseChange', function (response) {
alert('The status of the session is: ' + response.status);
});
};
// Load the SDK Asynchronously
(function (d) {
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
} (document));
</script>
<div class="fb-login-button" data-size="xlarge" scope="email" data-show-faces="false"
data-width="400" data-max-rows="1" autologoutlink="true">
Login with Facebook</div>
Die Login-Schaltfläche wird gerendert. und ich kann mich auch abmelden. Das einzige Problem ist, dass die Änderung von auth.response nicht ausgelöst wird und ich das Popup "Nachricht" nicht erhalte
FBML bald veraltet sein wird. Besser es nicht verwenden. – InspiredJW
@InspiredJW FBML ist bereits veraltet, das ist XFBML, etwas, das nicht veraltet sein wird –
haben Sie versucht, nur 'response [0]' zu überprüfen? Gemäß der Dokumentation, * Beachten Sie, dass in einigen Fällen der Wert der Antwort ist unkeyed, aber wenn mehr als eine Variable zurückgegeben wird, enthält sie die entsprechenden Schlüssel. * => http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ – PlantTheIdea