question

larissa avatar image
larissa asked

Using the package parameter of SendPushNotification

Hey there! :)

I've been trying to use the Package Parameter of SendPushNotification, as specified here:

https://api.playfab.com/documentation/server/method/SendPushNotification

https://api.playfab.com/documentation/Server/datatype/PlayFab.Server.Models/PlayFab.Server.Models.PushNotificationPackage

My requests look something like this:

{

	"Recipient": "9A9DB198169B0289",

	"Package":

        {

		"Message":"hi",

		"Title":"title",

		"CustomData":"mycustomdata"

	}

}

However all this does is send weird json in place of the message. Specifically

{"ScheduleDate":null,"Title":"title","Message":"hi","Icon":null,"Sound":null,"CustomData":"mycustomdata"}

So now I'm rather confused with my findings and could use some explanations:

1.) Am I doing anything wrong or is this how it is supposed to work?

2.) While on Android it would be possible to parse the message and build the notification manually, how would one prevent, that the above json is being displayed to the user on iOS, while the application isn't running?

3.) Why is the "Message"-field from the Package not used in the same way, as the normal "outer" message field would be used?

4.) Why is the custom data not submitted in the usual format in which iOS and Android would receive custom data?

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

·
brendan avatar image
brendan answered
10 |1200

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

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.