question

Kim Strasser avatar image
Kim Strasser asked

How can I send and receive push notifications?

My ARNs seem to be configured correctly but I don't know how to send push notifications in the Game Manager and I don't know how to receive them in my game.

I don't know how to set up the push notification service in my MonoGame iOS and Android projects. Do you provide a tutorial or at least some code to set up push notifications for people who use the PlayFab Xamarin SDK?

I have just found the Unity code here but I cannot use the Unity code in my projects:

https://api.playfab.com/docs/tutorials/landing-players/push-notification-basics/push-notifications-for-android

https://api.playfab.com/docs/tutorials/landing-players/push-notification-basics/push-notifications-for-ios

In addition, how can I write a simple message(for example "Hello to all players!") in the Game Manager and send this push notification to all the players?

Push Notifications
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

·
Seth Du avatar image
Seth Du answered

After ARN has been configured, you need to register push notification for players on the client.

  • For android
  • For iOS
  • After the player is registered, you may notice there should be a notification field in the player page:

    Be aware that you need to configure a push notification template if you are sending notification directly in the game manager and in terms of API calls, you can either call SendPushNotification or SendPushNotificationFromTemplate. More information is provided on our API references documentation website.


4 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.

Kim Strasser avatar image Kim Strasser commented ·

Is it possible to use PlayFab push notifications without Unity? I cannot use these tutorials because they use the Unity Engine and I don't have Unity.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Kim Strasser commented ·

Of course you can. Take Android push notification as an example, there are 2 things that the tutorial trying to tell us, which are 1, register your device with FCM; 2, register the playfab account with the device (via AndroidDevicePushNotificationRegistration API call). You can do it on any platform.

0 Likes 0 ·
Kim Strasser avatar image Kim Strasser commented ·

Is it necessary to add FCM messaging in Visual Studio to my iOS project or is FCM messaging only for Android projects? I don't know if I need FCM on iOS.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Kim Strasser commented ·

Currently PlayFab doesn't support FCM for iOS devices and in fact I am not sure if there is any backlog for it.

You may refer to Brendan's reply in this thread:https://community.playfab.com/questions/15918/fcm-ios-push-notifications-arent-working-android-d.html?childToView=16798#comment-16798.

In addition, there are more discussions about iOS push notification in our forum, for example, https://community.playfab.com/questions/17177/ios-push-not-received-in-application.htm.

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.