2
votes

I'm currently developing a game with Unity. My game is almost finished, and I want to add some Facebook features.

I add the Facebook last SDK (5.2.1) to my C# project.

Then, I add some functions, following the SmashFriends example : - FB.Init to Init the SDK - FB.Login to log the user - FB.Feed to post a story on the user timeline

Basically, FB.Init is called when I start the game. When the player finish his round, he got a score. Then, two choices : - User is already logged in, FB.Feed is called, with the score posted. - User isn't logged in -> Display the login popup

Here's my problem : When I test it on Unity, the login popup display correctly, so I can enter my Access Token, and the Feed popup display, I can post. But, when I test my app on Facebook (host on http://parseapp.com, no issue here), FB.Init is correctly called, and when FB.Login is called, I don't have any callback...

Precision : I use NGUI in my project.

I already searched the web, but found no solution =/

2

2 Answers

0
votes

It appears that in every scene you use a FB SDK functions, FB.Init should be called... After a day searching where was my error, I'm disappointed to see that it's not specified in the doc or nowhere else!!

Thanks to Stackoverflow corrector, to correct some parts of my questions! I'm sorry but I'm a french student ;)

0
votes

I think you can also implement the facebook functionality as a singleton with a DoNotDestroy. This should help you not loose init on switching scenes.