Facebook JS API - 登录后如何重定向用户
问题描述:
我有以下代码:
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();
}
});
}
});
我想要的是基本上将用户重定向到同一个页面,以便服务器端可以使用REST API。有没有办法使这项工作?
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?
答
订阅登录活动:
FB.Event.subscribe('auth.login', function (response) {
window.location.reload();
});