Per la vita di me non riesco a far funzionare Event.subscribe ('auth.authResponseChange'). Vedere codice qui sottofacebook FB.Event.subscribe ('auth.authResponseChange') non funziona
<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>
Il pulsante di accesso rende. e posso anche disconnettermi. l'unico problema è che la modifica auth.response non si attiva e non visualizzo il popup "messaggio"
FBML sarà presto obsoleto. Meglio non usarlo. – InspiredJW
@InspiredJW FBML è già deprecato, questo è XFBML, qualcosa che non sarà deprecato –
hai provato a controllare solo 'response [0]'? Secondo la documentazione, * Nota che per alcuni casi, il valore della risposta è unkeyed, ma quando viene restituita più di una variabile, contiene le chiavi appropriate. * => http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ – PlantTheIdea