question

philippe2803 avatar image
philippe2803 asked

I want to use Facebook Game Request feature? How would I go about that?

Basically, I have been looking at a facebook integration to invite facebook friends specifically, using the facebook feature "game request" in the form of invite. It is a feature that exists in the facebook API, but I've been unable to understand if I would be able to use it with Playfab/FB integration.

The feature in question is explained here: https://developers.facebook.com/docs/games/services/gamerequests#invites

I found no other threads in forums that specifically deals with this feature in the scope of Playfab.

Friends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
pfnathan avatar image
pfnathan answered

You could call PlyfabID as follows ... Note: it's just for the reference.

Below code are from https://developers.facebook.com/docs/games/services/gamerequests#invites UnitySDK

FB.AppRequest(
  message: "I Just got " + GameStateManager.Score.ToString() + " points! Can you beat it?",
  to: recipients,
  data: "{\"challenge_score\":" + GameStateManager.Score.ToString() + "}"
  title: "Friend Smash Challenge!",
  callback:appRequestCallback
);

Modify above code to something like this by adding "PlayfabId"

var playFabIdStored = "34098409234";
 
FB.AppRequest(  message: "I Just got " + GameStateManager.Score.ToString() + " points! Can you beat it?",  
   to: recipients,  
   data: {"challenge_score":1000, "PlayFabId":playFabIdStored } 
   //"{\"challenge_score\":" + GameStateManager.Score.ToString() + "}"  
   title: "Friend Smash Challenge!",  
callback:appRequestCallback
);

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

philippe2803 avatar image philippe2803 commented ·

I'm not entirely sure I follow. How is the PlayfabID related to Facebook SDK here? Is it actually a reference to the facebook token?

If playfab would let me use the token from facebook directly, I guess I could then build my own features around this.

0 Likes 0 ·
brendan avatar image brendan philippe2803 commented ·

Can you please clarify what you saw that implied the Facebook game request feature was compatible with PlayFab? We have custom game server hosting, which you can use to host game sessions, but we generate unique Lobby IDs for all games which are unrelated to anything in Facebook.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.