Próbuję użyć nowego interfejsu API Facebook Graph na mojej stronie. To jest to, co mam:Facebook Graph API: FB.login() zadzwonił przed wywołaniem FB.init()
gdzieś na stronie:
<fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"></fb:login-button>
zaraz po tagu:
<div id="fb-root">
</div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({ appId: '<%= ConfigurationManager.AppSettings["FBAppId"] %>', status: true, cookie: true, xfbml: true });
/* All the events registered */
FB.Event.subscribe('auth.login', function (response) {
// do something with response
alert("login success");
});
FB.Event.subscribe('auth.logout', function (response) {
// do something with response
alert("logout success");
});
FB.getLoginStatus(function (response) {
if (response.session) {
// logged in and connected user, someone you know
alert("login success");
}
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
ale gdy klikam na wygenerowanym przycisk logowania, nic się nie dzieje.
Ponadto Dostaję
FB.getLoginStatus() called before calling FB.init().
w konsoli Firebug.
Wszelkie pomysły?
co oznacza, że nie mijał klucz do sposobu FB.init. – sabbour
Mam ten sam problem, ale tylko na FF na MAC osx, działa we wszystkich innych przeglądarkach. Proszę, pomóż mi z tym. sprawdź moje pytanie http://stackoverflow.com/questions/3338198/facebook-login-plugin-issue-with-ff-on-mac-osx – Nnp
Czy możesz opublikować cały działający kod. Mam tutaj ten sam problem. Dzięki – Intellix