I followed the instructions here, and it works fine, when the Facebook App is not installed. When the official Facebook App is installed, the callback are not called after calling authorize, and I don't get back the token. When the app is installed, the shiny login screen comes up (from the Facebook app), when it's not, the webview.
I searched a lot, but every tutorial says I should use the sample from the page I linked. What am I missing?
// Facebook connect
public void facebookConnect(View v) {
/* CocktailflowTest AppID */
final Facebook facebook = new Facebook("134370943293463");
facebook.authorize(this, new String[] { "email", "offline_access" }, new DialogListener() {
@Override
public void onFacebookError(FacebookError e) {
e.getMessage();
}
@Override
public void onError(DialogError e) {
Toast.makeText(LaunchActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
@Override
public void onComplete(Bundle values) {
mFBToken = facebook.getAccessToken();
getPreferences(MODE_PRIVATE).edit().putString(Prefs.FACEBOOK_TOKEN, mFBToken).commit();
WebService service = new WebService();
WebServiceListener l = new LaunchWebserviceListener();
mDialog = ProgressDialog.show(LaunchActivity.this, "", "Logging in...");
mDialog.show();
service.connectWithFacebook(l, mFBToken);
}
@Override
public void onCancel() {
Log.i(TAG, "Facebook connect was cancelled by user.");
}
});
}