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?
Answer by 1807605288 · Oct 17, 2017 at 08:00 PM
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.
Answer by yyz291 · Oct 18, 2017 at 09:50 PM
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?
Sorry, I quoted my SDK version incorrectly! My SDK version is 2.29.171016
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!
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).