roughike / flutter_facebook_login

A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
BSD 2-Clause "Simplified" License
405 stars 331 forks source link

Not working on release #194

Open juanjoserodrigolazaro opened 4 years ago

juanjoserodrigolazaro commented 4 years ago

Hello, im using version 3.0.0 on my apps, when i test them there is no problem with this plugin but when i release the apps (android and ios) it does not work (the app on facebook developers is active not in development).

tuanitpro commented 4 years ago

Same issue. On iOS working perfect on Testflight, but Android don't work.

n0m4dz commented 4 years ago

Same issue here (Android).

juanjoserodrigolazaro commented 4 years ago

@roughike any idea?

Mapk26 commented 4 years ago

Hello everyone,

do not forget to add the Hash for Android in the configuration (facebook developer console).

n0m4dz commented 4 years ago

I have resolved it by generating key hashes which is generated using android keystore file. Then added release key hash in facebook android configuration. Followed this instruction.

Mapk26 commented 4 years ago

Please notice that you can have problems depending on the end-user device, for example if I have NOT the Facebook app installed, then everything works fine. The login comes in a webview.

If I try with the facebook app active, then the login try to use the native FB app and it can throw an error if my app key hash is not properly configured.

A workaround is to force the webview using:

facebookLogin.loginBehavior = FacebookLoginBehavior.webViewOnly;

kgrigorian commented 4 years ago

having my hash configures but still some androids fail to login

tuanitpro commented 4 years ago

I had configures hash key on Fb app, on Simulator which works well, but released version not work on real device (Samsung Note 9).

viniciuszani commented 4 years ago

I had login issues with just a set of devices (!?), while for the majority of our users the login was working perfectly in production. After some debugging, the error message we got was that the hash key did not match.

The steps below solved the problem.

If you use Google Play App Signing:

  1. Go to Google Play Console -> Release Management -> App signig
  2. In the App signing certificate, copy the SHA-1 certificate fingerprint value (AA:BB:CC...)
  3. Use this tool to convert it to base64: http://tomeko.net/online_tools/hex_to_base64.php
  4. Repeat the process with the Upload certificate SHA-1 certificate fingerprint
  5. Open https://developers.facebook.com/ and go to Configuration -> Basic -> scroll to Android
  6. Paste the base64 generated values in the key hashes and save it

Alternative:

  1. Generate your appbundle or apk using your tools (android studio, flutter, react native...) - here my example output will be app.aab (bundle)
  2. Go to the generated file using your terminal
  3. Run keytool -list -printcert -jarfile app.aab
  4. Copy the SHA-1 fingerprint and use steps 3-6 from the previous list
BenBao93 commented 4 years ago

@viniciuszani thanks! Finding the solution for this drove me crazy, as the signing cert through play store isn't mentioned anywhere. Makes sense of course now but the documentation should definitely reflect this as a hint somewhere.

tuanitpro commented 4 years ago

I had login issues with just a set of devices (!?), while for the majority of our users the login was working perfectly in production. After some debugging, the error message we got was that the hash key did not match.

The steps below solved the problem.

If you use Google Play App Signing:

  1. Go to Google Play Console -> Release Management -> App signig
  2. In the App signing certificate, copy the SHA-1 certificate fingerprint value (AA:BB:CC...)
  3. Use this tool to convert it to base64: http://tomeko.net/online_tools/hex_to_base64.php
  4. Repeat the process with the Upload certificate SHA-1 certificate fingerprint
  5. Open https://developers.facebook.com/ and go to Configuration -> Basic -> scroll to Android
  6. Paste the base64 generated values in the key hashes and save it

Alternative:

  1. Generate your appbundle or apk using your tools (android studio, flutter, react native...) - here my example output will be app.aab (bundle)
  2. Go to the generated file using your terminal
  3. Run keytool -list -printcert -jarfile app.aab
  4. Copy the SHA-1 fingerprint and use steps 3-6 from the previous list

Thank @viniciuszani this is helped me.