question

msorokin avatar image
msorokin asked

How to send a custom data in Push notification?

Hello.

Simple case, we have a multiplayer game. And player1 want to invite player2 to the game.

Player1 creates a multiplayer (non public) room and wants that Player2 joined to his game. The Player2 not in the game. How it should be done?

My only solution is Player1 should send push notification with custom parameters to Player2 via Playfab. When Player2 will open the notification, we can read custom data with room name, for example. But as I understand SendPushNotification fuction on Server does not have custom parameters.

How this situation should be solved?

Thanks.

Push NotificationsdataCustom Game Servers
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

·
brendan avatar image
brendan answered

We have the kind of advanced Push Notifications you describe for Android - here's our tutorial on that topic: https://api.playfab.com/docs/push-for-android.

However, it's worth noting that Push Notifications can be turned off at the device end by the user, and there's no notification to our service when that occurs. So it's not something you can depend upon. You'll also want to use data as a way to check the current status and determine if the player has a move available when he signs in.

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.

msorokin avatar image msorokin commented ·

Can you describe more detaily, what do you mean by "use data as a way to check the current status"?

As for custom push notifications, any cases for IOS?

Thanks.

0 Likes 0 ·
brendan avatar image brendan msorokin commented ·

Basically, you'd use User Read Only Data or Shared Group Data to store the state of the game. That way, each player could check it on login. There's a detailed discussion on this here: https://community.playfab.com/questions/515/207129407-Persistent-turn-based-games-.html.

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.