First I apologise if this topic has been already raised somewhere else. I am using the awesome ionic 3 framework for developing a simple android app which has facebook authentication. I have used the cordova-plugin-facebook4 from “https://github.com/amritk/cordova-plugin-facebook4.git” and it is working like a charm.
I am creating debug APKs and sharing it with my potential customer. I am able to login into facebook on my device (Samsung S8) running Android 7.0 and the behavior works as expected. Therefore my customer is not able to authenticate via facebook on his device. All other features of the app work accordingly and we are able to move development further, except this little issue with facebook authentication.
I thought you can give some hints on where I can look deeper to investigate and solve the issue.
Hi @gabrielmarchesan ,
The authentication issue may be related with the facebook app debug keyhash.So you have to collect the debug keyhash from your customer device and paste it inside the facebook app you have created on developer.facebook.com.
Thanks @vibinflogesoft! We plan to give the first alpha version to around 10 customers. Do you think would be possible to generate one production hashkey and share the same apk to different customers so they can authenticate over facebook?
@gabrielmarchesan Ys.There are two type of keys.one is debug key and another is the release key.The release key hash will help you to authenticate from multiple devices release key generation
Hi@gabrielmarchesan
One more thing you have do is in your Google play console
1.Go to Release Management
2.select app signing in releasemanagement
3.You can see sha1 key in hex format.
4.Copy the sha1 in hex format and convert it in to base64 format.
5.Go to Facebook developer console
and add the key(after convert to base 64) in the settings—>basic–>key hashes
Please let me know if you have any doubts:smile:
@vibinflogesoft, I would like to release my app only to some customers before making it available on play store… therefore I would like to be enable my customer to test the facebook login functionality as well. I still do not understand the reason why it works on my smartphone and not on his. We are installing from the same APK / which has been signed following the procedure previously described and we are getting different results. As authentication backend I am using firebase and it is working pretty well / on my mobile. If the app would not work on any device I could understand, but I do no see a logical explanation for that yet.
Hi@gabrielmarchesan
If you are trying to distribute the debug build to your some of the customers,the facebook login did not work for them.Because in case of debug build there will be seperate key hash for each of the device.In your case the debug keyhash is already generated and pasted it in your facebook developer console. Thats y the facebook login is working in your device.If you need to work the debug build on your customer device you should collect the keyhash from them.In the present situation the customer got an error screen while login to facebook.The error will be Invalid keyhash error(The keyhash does not match any stored keyhashes).So customer keyhash will shown in the error page.So collect the keyhash from your customer and paste on facebook developer console to fix the login issue.
Please let me know if you have any doubts
Hey@gabrielmarchesan
If your customers getting error will be just like this Invalid keyhash error
So they can view their key hash on their device screen while attempt to login.Try to append the keyhash on
facebook developer console to avoid the invalid key hash error.
please let me know if you have more doubts