Hi,
I have a currency that charges over time. When it is full, I want to send the player a push notification. I generated a segment for this:
Player:
Virtual currency balance (EN) is greater or equal to 10.
Action for entered segement:
Send push notification: My notification template
Unfortunately, no notification arrives even though the energy is full again. However, as soon as I log into Playfab and go to the "Segments" page, the actions for entered segement are triggered. But not by itself, what am I doing wrong here?
Thank you!
Stefan
Answer by Sarah Zhang · Aug 10, 2021 at 05:40 AM
We tried to use your condition to push several players to our testing segment, the actions set for [Entered Segment] can work fine. As the service status page showed, there was a known issue that caused delayed Play Stream event processing. This issue should have been fixed now. Could you please check again? If the issue still exists, could you please provide your TitleId for our investigation?
Thanks, I just tested it again. Unfortunately it still doesn't work. The currency recharges every 25 minutes, I spend 1 energy (EN) and thus had 9 EN and after 45 minutes there was still no notification. But as soon as I log into Playfab, go to the segment page, the notification suddenly comes. Or when I go to the player and go to the "Virtual Currency" tab the notification is also triggered.
Unfortunately, it doesn't happen automatically. Ideally, the notification should reach the player after 25 minutes (as soon as the currency is fully charged again). So that the player continues to play.
The TitleId is 773F5. Segment is "PlayerHasFullEnergy".
Thanks for helping and investigation,
Stefan
I've tried a few more things now and it looks like the currency won't charge itself (if the value is not picked up or displayed).
The event is only triggered as soon as the player logs in again or you load the value on Playfab (Virtual Currency tab). Probably the recharching of the currency is not always updated automatically in the background. I think it's a bug though?
What I also tried, I created a scheduled task, that calls a cloud script with server.GetPlayersInSegment ({SegmentId: "49A44063205D95FE"}); every 5 minutes. But unfortunately it doesn't help either.
Thanks for your response. We followed your steps and reproduced the behavior you mentioned.
For clarification, this behavior is by design. As this thread said, virtual currencies are only updated when required, for example, calling the API GetUserInventory, checking the VC tab etc. Currency recharging is not designed to be real-time.
For your case, you can set a scheduled task so that you can check the player's current currency in a certain of frequency, for example, calling the API GetUserInventory once hourly to update the currencies manually.
Error code 500 when viewing a list of Scheduled Tasks (history) 1 Answer
Scheduled Task was re-executed at the wrong time 0 Answers
Can not start scheduled task 2 Answers
Tasks not executing 1 Answer
Scheduled task affecting 0 players 1 Answer