I managed to incorporate the Facebook API into my project successfully, meaning, my game can take screenshots and post them into Facebook when clicking a button. However, this only works when running the application within the editor; touching that same button on my android device crashes the application instead (Unfortunately, appName has stopped).
I have been looking for a solution to this issue two days now, and while I came across a lot of different fixes, nothing seems to work; I already tried generating the correct hash key (with several different approaches), the apparently famous Rafael Fix, I tried fixing the screen orientation issue via AndroidManifest.xml, and I tried commenting the ScreenShot posting code (to make sure that Login is at fault).
I haven't made the app public on facebook, or uploaded to game to the play store yet (since it isnt ready for release yet anyways), but I don't think that should cause the game to crash like this.
I have a couple of days off my mandatory army service, and I really wanted to get this up and running before I had to go back to base. But, I am at my wit's end.
I'd really appreciate it if anyone could help me out with this.
// Some platforms return the empty string instead of null.
What version of the Facebook SDK are you using? The latest is v7.2.2 available here. On the latest SDK you will replace the ShareCallback parameter with a IShareResult. Check the upgrade guide for details. Also be sure to walkthrough the Getting Started with Android.
I'm using v7.2.2, and I did follow the getting started with android walkthrough thoroughly.
The parameter thing I something I didn't know though, I'll try it as soon as I get home (about half an hour), I really hope that solves this.
Your code work in your Editor but no in android phone.
Thank you! this works perfect!