In my android application, i have two buttons “login with facebook” and “login with twitter”.
Login with facebook
var my_client_id = "123412312323",
my_redirect_uri = "http://www.facebook.com/connect/login_success.html",
my_type = "user_agent",
my_display = "touch"
var authorize_url = "https://m.facebook.com/dialog/oauth?";
authorize_url += "client_id=" + my_client_id;
authorize_url += "&redirect_uri=" + my_redirect_uri;
authorize_url += "&display=" + my_display;
authorize_url += "&scope=publish_stream,offline_access";
authorize_url += "&response_type=token";
window.plugins.childBrowser.showWebPage(authorize_url);
using above url and child browser, i am asking user to login in Facebook.
using child browser’s on location change method, i am accessing the Facebook token form the redirection url.
I have logout button in my application, and i need to logout from facebook,
in logout method i have below facebook java script code
FB.logout(function(response) {
alert(response.text);
});
But, i got error that saying FB.logout() called without an access token
i saw below stack overflow questions
FB.logout() works only if i used FB.login for logging into facebook, isn’t it?
so, How to logout from facebook in my app?
I used child browser to logging in with facebook as i showed above and for logging out i used same child browser for logging out of facebook.