Can't login to facebook on my android device if facebook app is installed!

Hi there,

I have done facebook integration for my android game. Followed official facebook unity android tutorial from facebook and done successfully. Everything is fine but I noticed very strange thing that if my device has installed facebook app on it then i can never get logged in. If I uninstall the FB app then retries to login by my game then it’s working fine, unable to figure out the issue. Do I need to do something in facebook permission or something? any idea or suggestion pls.

Thanks in advance

I had a similar problem and it turned out to be an issue with the OpenSSL providing an incorrect Hash key to where you have to copy it from (it was missing a few characters).

This thread (especially the update to selected answer) can help with that: http://answers.unity3d.com/questions/543540/facebook-sdk-v424-android-login-not-working.html

You can quickly check if your keys match by looking at the output displayed in adb logcat from the FacebookSDK, it prints the key it’s actually using there (with extra
at the end for some reason).

First of all thanks AyAMrau. I was suffering with the same issue that is the generated hash key is not same. But I have done a tricky way to achieve that which is more simpler than any solution.

Easiest and best solution through which I have done FB integration is as following.

  1. Let your game app stay with the generated key hash in facebook edit setting. Don’t worry about the correct key hash.
  2. Make sure you have wrong android hash key pasted on facebook app setting in your developer account.
  3. Build your game and try log in with your Fb developer account.
  4. Now As soon as your game app doesn’t find the hash key then facebook app will pop up and taaaddaaaaaa. Here you go with correct key hash, just note down the hash key and now paste into your facebook app setting in your developer account

Worked like a charm!!!

Hello @urhire@yahoo.com , there will be a problem in your solution and the problem will be that the new generated hash key will only work for your device and in that case you have to use Facebook editor settings to change the hask key.

Hello, I had a same problem on my game. This solution is easy and correct

  1. Integrate the Facebook Latest SDK into your Project and Add your required id’s on your app.
  2. Build your app
  3. Publish on Google Play Console
  4. Open your Play Console Account
  5. Open your App
  6. Go to Setup > App Integrity
  7. Find the “Application Signing Key Certificate” Head
  8. Find “SHA-1 certificate fingerprint”
  9. Copy that key and paste the Hex to base64 converter , hex string area
  10. Then Click convert , and then copy the output(base64)
  11. Go to Facebook developer console and Open your App’s basic settings
  12. Pass the code that you are copy from tomekonet into Key Hashes area
  13. That’s it All