question

tom avatar image
tom asked

Push notification scheduling not working?

I'm trying the scheduled push feature as explained in the 'Playfab Push for Android' docs here:

https://api.playfab.com/docs/push-for-android

My message is coming through to device with the seemingly correct json format. But it's not scheduled. It always comes through right away.

This is the received message picked up by PlayFabGoogleCloudMessaging._MessageCallback:

{

"ScheduleDate": "18-10-2016 16:25:56",

"ScheduleType":1,

"Title": "Vote is OPEN",

"Sound": "raw/push",

"Message": "You can now make your vote"

}

I've checked the date and time on the android device is not past the scheduled date and time.

Is there anything I'm doing wrong?

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.

1807605288 avatar image
1807605288 answered

Our custom push plugin has been deprecated and deleted.

We have upgraded to use the official FCM plugin.

Scheduled push notifications were an exclusive feature of our old custom plugin, which we no longer support.

You can achieve similar effects by sending messages with customData to the FCM plugin, and adding your own CustomData, which would then be parsed by client-side code you write. FCM supports local notifications, so you would use your custom data to schedule a second local notification at the indicated time.

This is now entirely your responsibility, within Unity, using the callbacks available in FCM. It's not a native FCM feature.

We've also deprecated the "ScheduledDate" parameter in our own push notifications API, as it won't work for anything but our deprecated/deleted custom plugin.

For all customers, we would suggest you upgrade to FCM and implement the scheduled feature yourselves, or use a 3rd Party Push Service that has scheduling features.

10 |1200

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

brendan avatar image
brendan answered

Sorry for the delay on this. I've reproduced this issue and opened a bug with the tools team to get this fixed. We'll update as soon as we can with more info on the fix.

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

tom avatar image tom commented ·

Hi Brendan,

Thanks for the message. I was just wondering if there was any update, or an idea of when this might be fixed?

Tom

0 Likes 0 ·
brendan avatar image brendan tom commented ·

Our tools team is looking into this bug, but I don't have a timeframe for the fix just yet. I have asked them to update this thread as soon as they have this issue resolved.

0 Likes 0 ·
brendan avatar image
brendan answered

Actually, on re-testing, I'm seeing that scheduled push is actually working as designed - I made a mistake in my test by using mm-dd-yyyy, when it's actually dd-mm-yyyy. Can you give us more details on your repro? Specifically what calls are you making, and what are the input parameters you're using?

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

tom avatar image tom commented ·

Hi,

I'm using a cloud function to make the call, it's calling server.SendPushNotification.

The request.Message parameter is made to the following format:

{

"ScheduleDate": "18-11-2016 16:25:56",

"ScheduleType":1,

"Title": "Vote is OPEN",

"Sound": "raw/push",

"Message": "You can now make your vote"

}

The other parameters are Recipient (the playfab id) and Subject (just a string).

As I said, the push comes through ok but the message is not scheduled, it comes through straight away. Looks like I'm sending the date in the right format?

This is the console log from the API:

I/PlayFabUAP( 4211): Message was JSON

I/PlayFabUAP( 4211): Message Recieved: {

I/PlayFabUAP( 4211): "ScheduleDate": "18-11-2016 11:35:03",

I/PlayFabUAP( 4211): "ScheduleType":1,

I/PlayFabUAP( 4211): "Title": "Vote is OPEN",

I/PlayFabUAP( 4211): "Sound": "raw/push",

I/PlayFabUAP( 4211): "Message": "You can now make your vote"

I/PlayFabUAP( 4211): }

Thanks

Tom

0 Likes 0 ·
brendan avatar image brendan tom commented ·

Just to make sure we're isolating the variables in this test, does the message get delivered at the correct time (and note that the time in question is the time of the local device - not UTC or any server-side time) if you remove the Sound from the message?

0 Likes 0 ·
tom avatar image tom brendan commented ·

Hi,

Thanks for the suggestion - I've just tried that now. However it didn't have any effect:

I/PlayFabUAP(27378): Message Recieved: {

I/PlayFabUAP(27378): "ScheduleDate": "21-11-2016 11:45:25",

I/PlayFabUAP(27378): "ScheduleType":1,

I/PlayFabUAP(27378): "Title": "Vote Reminder",

I/PlayFabUAP(27378): "Message": "Please log in and make your vote."

I/PlayFabUAP(27378): }

The local time on the device was 21st November 2016, 11:41 - but it still received the push instantly.

0 Likes 0 ·
Show more comments
Show more comments

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.