Search code examples
androidfacebooksharefacebook-unity-sdk

Unity Android Facebook - Not Working on Device


I am having an issue with sharing on Facebook from my Unity app on android. It is really weird, the first time I built and ran the app on my device the facebook share pop up worked. Then I tried to build and run it again, this time from a different machine and it acts like it works but then it just flashes and the share popup never displays.

I have changed my Key Hash to match what is on the Facebook settings for my machine. I can test it on the machine and use the token and it works fine.

My settings on face book then should be good I would think since it works from the computer, but what would cause it not to work from my device?

I hope someone can help, any suggestions are greatly appreciated!


Solution

  • The issue here was that in using the Key Hash that is output in the Unity UI does not work/is not correct. I had to generate the Hash using the java keytool in the cmd prompt or terminal.

    IE:

    keytool -exportcert -alias alias -keystore ~/user.keystore | openssl sha1 -binary | openssl base64