I have the following code:
FB.getLoginStatus(function (response) {
if (response.session) {
} else {
FB.ui({
method: 'oauth',
perms: 'email,publish_stream',
},
function (response) {
if (response && response.installed) {
window.location.reload();
}
});
}
});
What I want is to basically redirect the user to the same page so that the serverside can use the REST API. Is there anyway to make this work?
I have the following code:
FB.getLoginStatus(function (response) {
if (response.session) {
} else {
FB.ui({
method: 'oauth',
perms: 'email,publish_stream',
},
function (response) {
if (response && response.installed) {
window.location.reload();
}
});
}
});
What I want is to basically redirect the user to the same page so that the serverside can use the REST API. Is there anyway to make this work?
Share Improve this question asked Apr 25, 2011 at 19:49 RaphaelRaphael 8,20214 gold badges64 silver badges86 bronze badges2 Answers
Reset to default 5Subscribe to the login event:
FB.Event.subscribe('auth.login', function (response) {
window.location.reload();
});
Use this.
FB.Event.subscribe('auth.sessionChange', function (response) {
if (response.session) {
//user is logged in!
window.location = document.URL;
}
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744743203a4591151.html
评论列表(0条)