0

I have put all the necessary data to Facebook for enabling the user to login Facebook every time they want, so far I have included 3 key hashes from debug key, release key & the one that has been generated by using package manager in app. Thus, it seemed to work for a certain time for the user to access.

However, I tried to log out after particular amount of time (like a month or more than that) & log in my Facebook account back using my app, the key hash changed and I suddenly cannot log in as the key hash doesn't match to all I have added before. Whenever this happen, I need to manually add the key hash the Facebook again and only then the login can work.

Does the key hash has its own valid period for access Facebook account? Does everybody know how to handle this issue? Kindly need your opinions regarding this issue, thanks.

Ste
  • 1
  • 2

1 Answers1

0

Would this issue be able to help you by any chance:

android facebook integration invalid key hash

Hope it helps.

Another thought that I came up with is that key hash is suppose to change if you sign your application with another keystore (e.g. you generate a new one).

anteAdamovic
  • 1,462
  • 12
  • 23
  • Thanks for reply. I have tried that before, but the key hash just keep changing after certain amount of time and I need to manually add the new key, isn't it that the key hash will not change once submission? – Ste Aug 02 '17 at 09:41
  • I've updated the answer with another thought after discussing it with a colleague, key hash shouldn't change completely randomly. I am NOT sure if it changes if you change your app ID but it's possible. You should check for any changes on your app in the time when the key hash changed. – anteAdamovic Aug 02 '17 at 09:50
  • Does that mean the key hash might change if we update the app? What else are the conditions will trigger the change of key hash? – Ste Aug 03 '17 at 01:35
  • Key hash is calculated by using a hash function on your app id and app signature (for release versions). So, in terms, if you change your app id and/or change your signature (keystore) . – anteAdamovic Aug 03 '17 at 14:14
  • For what i know, I have neither changed any app id on Facebook developer nor in the app. Also, I submit the same keystore every time I update the app. So, I still can't understand what makes the key hash change after a certain amount of time. – Ste Aug 10 '17 at 04:01
  • The login only work after I generate fully signed apk from the app. Has anyone known why do we need to generate apk in order to enable the fb login to work? – Ste Jan 09 '18 at 04:06