I’m trying to make an app for android using facebook’s SSO, so first i made a test app to test their api.
I’ve been following the Android starting tutorial here on the facebook dev site. All was working well. When the app got started it would let me sign into facebook using its traditional webview login (since facebook wasn’t installed on the emulator). Then i noticed that if you have facebook already installed then it would use a more fancy screen to log in.
So i installed facebook, opened the app, all went well. Closed and reopened the app and the facebook reauthorize screen popped up but this time with no info on it..

Which is abit odd… so when i click on ‘Ok’ this shows up..

so if i click ‘ok’ again it just opens facebook in a browser.
If this something to do with my code? Or something on Facebook’s side? I have the same problem on both an emulator and a real device. The emulator was running facebooks dev app which came with the sdk, and the device has the latest facebook app from the android market.
The code is here..
public class Home extends Activity {
Facebook facebook = new Facebook("Blanked the ID :)");
String FILENAME = "app_data";
private SharedPreferences mPrefs;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mPrefs = getPreferences(MODE_PRIVATE);
String access_token = mPrefs.getString("access_token", null);
long expires = mPrefs.getLong("access_expires", 0);
if (access_token != null) facebook.setAccessToken(access_token);
if (expires != 0) facebook.setAccessExpires(expires);
if (!facebook.isSessionValid()) {
facebook.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {
// TODO Auto-generated method stub
}
@Override
public void onFacebookError(FacebookError e) {
// TODO Auto-generated method stub
}
@Override
public void onError(DialogError e) {
// TODO Auto-generated method stub
}
@Override
public void onCancel() {
// TODO Auto-generated method stub
}
});
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
Thanks in advance for any help! (:
Try to disable the enhanced auth dialog here after you choose your application
App settings-> Advanced Settings -> Enhanced Auth Dialog: Disabled
Cheers.