Ben avatar image
Ben asked

Time-Zone Specific Push Notifications

Hey! My studio is considering integrating Playfab for a number of reasons. Before we start, I'd like to answer a question about push notifications:

Will Playfab's Push Notification system allow us to do the following?

We want to:

  • Send out a Push Notification to users encouraging them to play our new game update.
  • Schedule that notification to arrive between the hours of 4-6pm in their local time zone.
  • Have that push notification arrive on a specific day of the week, to all applicable users.

Anyway, seems pretty simple, but the service we're using right now can't guarantee either time of day, or which day the notification arrives on. We'd like to find one that can be more reliable, as time of day is something relevant to the way people use our game.

Either way, we're probably still gonna use playfab for backend services, but would be good to understand if it will also solve this problem, because otherwise we have to budget for Urban Airship or a comparable service on top of this one.

Push Notificationsscheduled tasks
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

Yes, the way our Push Notification works, there's a specific API you call, and the Push goes out when that happens. In the case of trying to send Push messages to a lot of users, you'd use player Segmentation via PlayStream (, which can be set to hourly/daily/weekly, as well as a CRON expression, and then use a Scheduled Task to send the Push to those players (

Taking an action based upon the player's timezone is possible, if you create player segments for the timezones, but I'd actually recommend using the player's last play time as the way to determine when to send the Push, since that will mean it's targeting when that particular player is actually playing the game (so, in the Segmentation service, use the last logged in time).

10 |1200

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

Ben avatar image Ben commented ·

Thanks @Brendan! Seems like this does everything we need it to. I've already got push notifications working when sent manually. Will attempt to create a segment and send to myself with a scheduled task.

0 Likes 0 ·
Ben avatar image Ben commented ·

After reading through those documents, I'm not sure I understand how to use them to achieve the effect I want.

I'd like to Schedule an announcement that all players see, and have it happen exactly one time:

example push notification: "Hey! new app version 1.1 is out now! Check out the new content"

I'd like all players who first installed on an older app version to see it. I'd like them to see it at a certain time of day when they would most commonly be playing. I don't think using lastPlayedTime would be sufficient, but rather some calculated value about what time of day they most commonly play.. OR using a set time in their timezone.

- How do I filter out players who installed on an earlier app version? The App Version is a string, so I need to store it in PlayerData, which I can't figure out how to access in the Segment editor.

- How do I segment via playstream as you mentioned in your post? I only see certain values like lastPlayedTime.

- How do I delay the push notification action to occur until the right time, after I've run the task? I don't want to trigger this message more that once, so it has to be triggered manually. Is this something I can do with CloudScript?

0 Likes 0 ·
brendan avatar image brendan Ben commented ·

Then you would track the version number of the game as a player statistic (just use different parts of the int to represent major/minor) or Tag, and use that to Segment your users. If you want to also track on last time played, so that you can try targeting users around their normal playtime, you would also use that as part of your segmentation filter logic. Or you could just use it as I described above, and use Cloud Script to send the push, but first check the player data for whatever you want to check, to see if you want to send them the Push.

But segmentation of users is specifically described in the tutorial above. If you click the filter drop-down, you'll see all the things you can use as filter properties.

As to delaying for the right time, that's why I'm suggesting using the last played time to separate the users into groups by when they play.

Alternately, you could have this logic driven on the client side, scheduling a local notification, and put info in Title Data for upcoming messages you want the game to deliver to the player.

0 Likes 0 ·
Ben avatar image Ben brendan commented ·

Okay interesting. What about this?

  • Track install build version on every player account
  • Track timezoneOffset as int in player statistics (e.g. 0, -7, 4, etc).
  • Track last update version player was notified about on every player account
  • Track latest released build version in Title Data
  • Create segment for players who
    • Have push notification ability
    • Whose last version they were notified about was older than the latest release build version in Title Data
  • Create CloudScript that evaluates if a player is at the right time of day to receive a push notification, and has never been notified about the Title Data latestReleasedBuildVersion yet.
    • If they qualify for a push notification, using their timezoneOffset, they are sent a push notification. Can I send push notifications from inside a CloudScript?
    • Set the last version they were notified about in their statistics to the current version in Title Data
  • Create a scheduled task that runs the above CloudScript at the start of every hour on all the players in the above Segment. This will reduce down to a size of 0 players once 24 hours have passed.

Is everything I described above doable in your systems?

0 Likes 0 ·
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.