1
votes

i am currently building a game with Unity for Android. I want to use the AppRequest feature from the Facebook API.

User should be able to challenge their friends.

I implemented it just like in the tutorial (https://developers.facebook.com/docs/unity/reference/current/FB.Apprequest)

FB.AppRequest(
    message:"message",
    title:"title",
    callback: appRequestCallback);

I have the following permissions:

  • basic_info
  • publish_actions (to post the score)
  • friends_games_activity (to see the scores of the friends)

And yes, I am logged in. I check that directly before that.

I tested it with development mode on and off.

If I run the game on Android and click the button that calls the method, Facebook tries to load something, but it will never appear. I see the load-icon (this turning circle thing) but nothing appears and I am back in my game. It looks like everything is directly cancelled.

If I run the game in the Unity Editor everyhing works just fine. I can see my friends and send them requets.

What am I missing? It's driving me crazy.

Do I need another permission?

Everything else works perfectly with the FB SDK.

2

2 Answers

0
votes

I have encountered a similar problem with Facebook Unity SDK, which was solved by passing more parameters - these marked as optional too.

It shouldn't work like that, but they're still working on that plugin, so maybe you could give it a try, and specify all parameters you can, or manually pass them default values.

0
votes

I found the solution.

I passed to many characters in the message and title strings. Therefore my question was maybe misleading, because I replaced the strings with short dummy values.

If you encouter a similar issue: The length of message should be at most 60 characters. The length of title should be at most 50 characters.

I tried it on another phone got an error message there. On my phone the dialog just did not appear.