Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

(SOLVED) Problem with Login Facebook SDK + Android

Discussion in 'Android' started by sandolkakos, Jul 17, 2014.

  1. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    189
    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. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    189
    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:
    Code (csharp):
    1. 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 :D
     
  3. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    83
    Just wanted to thank you, point A solved the issue in my case :)
     
    sandolkakos likes this.
  4. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    189
    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 :p
     
    Elkis likes this.
  5. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    83
    At least not in 4.5 , I remember that last month I had to generate the Key Hash and copy it from the Logcat :(
     
    sandolkakos likes this.
  6. cgydev

    cgydev

    Joined:
    Oct 2, 2015
    Posts:
    14
    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.
     
    sandolkakos likes this.
  7. sandolkakos

    sandolkakos

    Joined:
    Jun 3, 2009
    Posts:
    189
    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.
     
unityunity