question

Ion avatar image
Ion asked

Scheduled notifications - How to call

Hello!

I have configured Android push notifications, and i was trying to set up scheduled notifications from cloud script, without success.

I have been trying this way:

var message = {};
message["Title"] = "test message";
message["Message"] = "This is a test message";
message["ScheduleDate"] = args.date;
message["ScheduleType"] = 1;


log.info("Send message:", JSON.stringify(message));


// try to send push notification
try {
	server.SendPushNotification({
		Recipient : currentPlayerId,
		Package: message
	});
} catch (ex) {
	// Target player has not registered for Push Notifications
}

I have read some posts about this, but they are old, and i didn't found a solution for this.

Thanks in advance!

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

Okay, Scheduled Notifications aren't directly supported, but can be managed with a custom plugin. Here's the post where we discussed this: https://community.playfab.com/questions/5940/push-notification-scheduling-not-working.html.

And here's the doc page on Push, which talks about using a third-party of custom plugin to do scheduled Push: https://api.playfab.com/docs/tutorials/landing-players/push-notification-basics/push-notifications-for-android.

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.