I am trying to make a game in Unity3D with new facebook unity sdk. I am able to send an AppRequest to the friends in my list. But my doubt is, after my friends has downloaded the same game, how can I communicate with friends using the AppRequest.
For eg. If I am sending a "Life" to the friend, my friend should see a "Life" sent from me in his game. his "Life" counter should get incremented by 1 (life++). Same thing with "Ammo" can be done.
- Sender : How to differentiate the "Life request" and "Ammo Request".
- Receiver : In game, how to get that request and differentiate it, so that "Life" or "Ammo" counters gets incrementation.
You have two options:
One other thing to pay attention to is if a player comes to your game via an app request, which you may want to respond to or notify them of. For example on Canvas: - Bobby McGee visits https://apps.facebook.com/friendsmashunity, sends me a request via FB.AppRequest. the return value of that call will be something like:
{ "request": "467375710036144", "to": [ "my_user_id" ] }
Then I see a notification like this:
When I click on this link it opens up your game with the following parameters (you can see request_ids is one of them) - https://apps.facebook.com/friendsmashunity/?fb_source=notification&request_ids=467375710036144&ref=notif&app_request_type=user_to_user¬if_t=app_request
You can get the 'data' from an appid by calling FB.API:
Hope this helps, and thanks for trying the SDK!