I am currently developing an application on Android using phonegap and want to use Facebook in the application. I created a Facebook application called Test. When I do not enter the “Test”, but I am registered on Facebook (the Facebook application on the Android device) and run the getLoginStatus () function, I get an unknown response instead of not_authorized . So my first question is this? I wanted to get an unknown answer or is it a mistake from a telephone hell, and I should get a not_authorized answer.
The second question: when I enter the Facebook application called “test”, everything works as it should (a Facebook user logs in for the “test”). When I call the getLoginStatus () function, it works fine and says that I am connected without problems.
BUT
If I go to Facebook and delete the “test” application from my FB account and then run the Android application again and run the getLoginStatus () function, STILL says that I have the “test” application registered in my Facebook account, but it is not! Please note what I am doing in the code so that I call the server every time, and not use the cached result of the JS SDK. Now my second question. Is this supposed to happen? Or if this is not a Facebook or Phonegap problem (Phonegap either continues to receive a cached response, or Facebook does not update its side quickly enough?)
Here is the code:
function getLoginStatus() { FB.getLoginStatus(function(response) { alert(JSON.stringify(response)); alert(response.status); if (response.status == 'connected') { alert('logged in'); FB.api('/me',function (response) { if (response.error) { alert('There is an error'); } else { alert(response.name); } }); } else { alert('not logged in'); } },true); }
Any answer really like it!
source share