1

I am having a issue with facebook login. I am using facebook sdk 4.3.6 and unity3d 4.3.0/4.3.1.

when I hit login button Facebook permission windows open and after pressing ok nothing happens and following message is printed in logs

" sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"asdasd"}) "

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

and in

void LoginCallback(FBResult result)                                                        
    {                                                                                          

        login = result.Text; // output  login=false, userid="", access_Token=""

    } 
Sheheryar Aamir
  • 497
  • 1
  • 5
  • 12
  • Can you please add the facebook-unity-sdk tag to this question? – benp Dec 09 '13 at 19:28
  • Are You able to make the build of this in android? Do let me know As I am facing some errors when it compiles. For Details, check out my question. Maybe you can help me out : bit.ly/1bKnOPo – Siddharth-Verma Jan 21 '14 at 07:27

1 Answers1

2

Not sure what the above answer is...Why does JSON have to do with anything?

I am having the same problem...was using Facebook SDK 4.3.4 and was having the same problem. I saw there was a new one up 4.3.6 and tried it...same problem.

I check LOGCAT and saw the same line: sending to Unity OnLoginComplete({"cancelled":true,"key_hash":"4EbLC........0uFU1A="})

Which is NOT my has from my UNITY Facebook settings...I have no idea where it is getting this HASH from.

I am wondering if the "cancelled":true result is a result from the Facebook Dialog to allow permissions ..although I did not click CANCEL

I am going to try the only thing I haven't tried yet and that was a post from someone to get the latest OPENSLL and regen the keys...


SOLVED: OK Here is what I did to get it working....

I added that Hash that I got from the LOGCAT to the Facebook Develop App Settings on develop.facebook.com/apps

Now it logs in me in...

I just don't know where that Hash is coming from...I also have the hash that was generated from Unity in there as well.

Ryan

Ryan Jones
  • 111
  • 1
  • 9
  • Check out this question: http://stackoverflow.com/questions/13894006/android-facebook-sdk-3-0-gives-remote-app-id-does-not-match-stored-id-while-lo/14421260#14421260 Basically, openssl is used to generate that key hash, but certain versions of openssl are unreliable. The version of the hash that comes through with the login callback is the definitively correct one. Even worse, if you are publishing to the amazon store for kindle devices amazon will resign your app after you submit it. In that case the only way to get the correct keyhash is to check the login return value or contact amazon. – benp Dec 09 '13 at 19:27
  • @benp Need help. Here's my question : bit.ly/1bKnOPo – Siddharth-Verma Jan 21 '14 at 07:29