question

yyz291 avatar image
yyz291 asked

PushNotificationPackage no Badge property

I'm trying to show a Badge number on my app when I send push notifications. According to https://api.playfab.com/documentation/Server/datatype/PlayFab.Server.Models/PlayFab.Server.Models.PushNotificationPackage there is a Badge property which I can set, but when I create a PushNotificationPackage, the 'Badge' property doesn't exist in the PlayFab ServerModel SDK. Am I doing something wrong? If not, how may I get the badge to show up on my iOS device?

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

1807605288 avatar image
1807605288 answered

That badge property was made public on the website a little too soon. Apologies.

It is now released however:
https://api.playfab.com/releaseNotes#171016

Update your SDK to the latest version, and it should work.

10 |1200

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

yyz291 avatar image
yyz291 answered

Just noticed that there was a PlayFabSDK update yesterday which included the new Badge property! That is really great! However after installing the latest SDK (17.29.171016), the push notification is delivering the json directly as a notification to my iOS device (see image attached) instead of the message when I try to set the package (PushNotificationPackage) to send in my PushNotificationRequest. The push notification is seen but its message is wrong. There is also no badge displayed.

This also occurs when I use the Game Manager to send a Push Notification to my player when I enable the "advanced" toggle under it. If I send a message normally without the package, or without the "advanced" toggle checked in Game Manager, my message is sent normally. Attached are also screenshots of my function calls if necessary.

Is there anything that I have missed out to make it work?


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

yyz291 avatar image yyz291 commented ·

Sorry, I quoted my SDK version incorrectly! My SDK version is 2.29.171016

0 Likes 0 ·
yyz291 avatar image yyz291 commented ·

Okay I managed to figure it out - turns out I hadn't updated my Push Notifications to FCM for my title in the Game Manager > Settings > Push Notification. Problem is solved and managed to get badges displaying properly now!

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ commented ·

I see you already found it, but for everybody else, you need to find and push this button:

NOTE: It will also upgrade your Android push messages, which will require updating to FCM or another compatible 3rd Party Push Plugin (we know a few others work, but we don't have a definitive list yet).

0 Likes 0 ·
untitled.png (41.1 KiB)

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.