I\'m getting a weird facebook connect behavior in my app. If I use it in emulator, the calls for facebook.request (to retrieve user data) and facebook.dialog (to post on wal
Facebook Connect is SSO flow, and when it is done onActivityResult is called back. you should handle the response in there
simple example
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == AppContext.FACEBOOK_SSO_ACTIVITY_CODE) {
// Successfully redirected.
if (resultCode == Activity.RESULT_OK) {
// Check OAuth 2.0/2.10 error code.
String error = data.getStringExtra("error");
if (error == null) {
error = data.getStringExtra("error_type");
}
else {// SSO successful
String access_token = data.getStringExtra("access_token");
// from here on, you can do whatever you need
}
}
}
on the other hand, I suggest two implement both options (sso and oauth as fallback). here is an example implementation for both Facebook SSO and OAuth; https://github.com/wareninja/generic-oauth2-login-for-android