I am newbie on facebook api and I make a login with facebook application but when I enter any page api redirect main page . I want to stay page that I was . forexample :
I'm in main/news/nba-orlando page and I want to login with facebook and I click the button then popup show. If i accept, api redirect main bu I want to stay main/news/nba-orlando page ...
how can I do that ?
FB.init({
appId : '{api_id}',
redirect_uri : document.URL,
cookie : true,
xfbml : true,
version : 'v2.5'
});
FB.init is only for initializing the JavaScript SDK and there is no redirect_uri parameter as you can see in the docs. FB.login is for login, you can redirect with JavaScript after login:
FB.login(function(response) {
if (response.authResponse) {
//user just authorized your app
window.location.href = 'xxx';
}
}, {scope: 'email'});
More information: http://www.devils-heaven.com/facebook-javascript-sdk-login/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With