0

I have added the key hash logged by this call (plus an equals sign) to the settings for my app on the Facebook developer site.

Log.d("MyApp", FacebookSdk.getApplicationSignature(this));

I can repeat the following steps indefinitely. Facebook login works the first time, but fails on all subsequent attempts.

Facebook App (v91.0.0.17.68)

Facebook Android SDK (v4.15.0)

  1. Revoke Facebook Login at https://www.facebook.com/settings?tab=applications
  2. Login with Facebook
    • Success
  3. Login with Facebook

The KEY_HASH in the error messages exactly matches one of the key hashes I have saved to the app on the Facebook developer site (at the link listed in the error message).

This only happens when the Facebook app is installed on the device. Facebook login succeeds multiple times in a row using the fallback web login.

I've found this and this question that have a combined single answer of "revoke Facebook Login manually in the app before trying to log in again" which seems like a hacky workaround to me.

Why do you have to revoke Facebook Login before logging in again? With the web fallback login it just says "you've already authorized this app". I would expect the same behavior here.

Edit: This only happens with a debug build. I can login repeatedly with the Facebook app installed if I use a release build (minify disabled just to reduce the changes).

Community
  • 1
  • 1
mpkuth
  • 6,994
  • 2
  • 27
  • 44

1 Answers1

-1

Same thing happened to me and I had generated hash from debugkey for debugging in dev enviroment but when building it for Google Play the problem was appearing. You need to generate hash with the certificate and alias that you will sign the app for publishing in Google Play.

Edit: You need to add key hash for both debug key and release key.