(SOLVED) Problem with Login Facebook SDK + Android

Hi guys,

I’m using the “Facebook SDK 5.1” with “Unity 4.5.2 - Mac version” to Build my Android App.

The App was successfully builded, but I can only execute “Facebook Login” if the “Facebook App” is not installed in the device.

When the Facebook App is installed, after I input my FB Account and go back to my App, it is not logged in the Facebook, but when the Facebook App is not installed, it works perfectly.

Someone here already have faced this problem?

Here is my App to you test (Test Login with and without Facebook App installed):
https://play.google.com/store/apps/details?id=com.SandolkakosDigital.EoParaibaWORLD

Thanks,
Marllon Brando.

2 Likes

I have solved this problem. And to solve, I had to do 2 things:

A) Use only the “email” and “publish_actions” in the Facebook Login Scope. So, now I do Login in Facebook like this:

FB.Login("email,publish_actions", callback);

B) The “Key Hash” generated in the Unity Engine was wrong. So, now I am generating the Key Hash through the steps:

I know other developers are passing by these problems too. So I hope my steps can help them :smile:

5 Likes

Just wanted to thank you, point A solved the issue in my case :slight_smile:

1 Like

You’re welcome Elkis. Later I want to test if the “Key Hash” generated by Unity Editor was fixed, because last time I worked with that was a long time :stuck_out_tongue:

1 Like

At least not in 4.5 , I remember that last month I had to generate the Key Hash and copy it from the Logcat :frowning:

1 Like

I am both Happy and Disappointed. I am Happy that my issue of Facebook App login not working is solved by using the A & B solution.
I am disappointed that even in 2020 Facebook’s FAQ has not included the issue caused due to wrong key hash generated by the process they have mentioned in their docs.

Thanks @sandolkakos for the solution suggested in 2014 from 2020.

1 Like

Oh no! It is really sad to know that issue is still there, but I’m also happy to know the steps can still help.

@sandolkakos you deserve a beer haha. 2021 and still the same problem. Thank You!!! A and B worked for me.

1 Like