question

romangolenok avatar image
romangolenok asked

Send push notification when currency is fully recharged,Send push notification when virtual currency is recharged

Hello,
we have virtual currency that is recharging every hour for some point and have maximum value. Let's call it "Energy" and we want to send push notification to player when this currency is fully recharged.

I believed that can use EventStream for that. But as I undestand player currency is recalculated ONLY when player requests inventory.

And as I understood playfab can not send "delayed" push notification anymore.

So how I can implement this logic using playfab?
Or I can't and should think about other services like OneSignal, etc. ?

1 comment
10 |1200

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

romangolenok avatar image romangolenok commented ·

Sorry for title duplication, it's a bug in community.playfab when posting question from draft, title is empty...

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Apologies for the confusion - I've removed the previous answer, as it was confusing the issue. Virtual currencies are only updated when required - that is, when you're requesting the inventory of the player (and so, the VC balances), or when making a purchase or granting currency. So obviously, there's no way to auto-trigger a notification from the service when the player's VC balance would be maxed from regeneration.

What you would need to do in this case is use a scheduled Push - so, use the information on the player's virtual currency while the game is running to determine when it will be maxed, and set a Push to be delivered at that time. You'd use UNNotificationRequest (https://developer.apple.com/documentation/usernotifications/unnotificationrequest) for this on iOS, though unfortunately, Google does not provide similar functionality with Android and FCM, so you would need to use a third-party plugin that can something like a "ScheduleDate" parameter (as described here: https://blog.playfab.com/blog/push-sep-17).

1 comment
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 commented ·

Also, clarifying one additional thing based upon your previous response:

Segment evaluation is a result of an event being evaluated in PlayFab, or a process which requires re-evaluation of the segment, like a scheduled task. So, a player does not enter a segment based upon not having signed in for some period of time, as there's no event for that. And as with the VC changes, it's not possible for us to re-evaluate these conditions every second, for every player in the entire service.

Running a scheduled task to check for 'lapsed' players (those who haven't signed in for a long time) will result in re-evaluation, but that's not something you could do frequently. So the scheduled Push described above would be the way to go.

0 Likes 0 ·

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.