简体   繁体   中英

Facebook Auth - Android App - Built on Ionic - Key Hash procedure

I'm building an Ionic app that uses Firebase and Facebook to authenticate the user. I'm at the point where when I hit the login button on my app, the Facebook app tells me:

Invalid key hash. The key has <key_hash_here> does not match any stored key hashes. Configure your app...

I can't find any information at all on how this works.

  • Do I need just a hash in the Facebook dev console?
  • Do I need that same key also in the app somewhere, and if so, where would I put it in Ionic?
  • Do I need to do anything with Firebase at this point, I'm pretty sure I don't need to.

I used

keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64

to create a key, substituting some name related to my app for <RELEASE_KEY_ALIAS> and "C:\\" for <RELEASE_KEY_PATH> .

The command line returned a nice little hash, ending with "=", so it's doing it's job. I don't have an physical files it outputed.

I'm so confused as to if I need a physical file, and if so does it go in my app AND in the Facebook dev console.

Basically you want to use Facebook Auth in your Ionic App if i understand correctly

I would recommend to double check the process you did to add your key hash on the Official Documentation for Facebook Native on Ionic or in this external tutorial which is also well explained

If both fail try the following:

  1. Delete any app on the website of Facebook (developers.facebook.com)
  2. Delete the file debug.keystore
  3. Generate a new hash key
  4. Create a new app on developers.facebook.com and add the new hash key
  5. Re-run your app
  6. Success!

Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM