question

developerjazzhaq avatar image
developerjazzhaq asked

Limit number of push notifications.

Hi,

I am trying to implement call to play feature in my multiplayer game where players can call their friends using push notification system to play. But I know there are some notorious people like me :) who will try to use this feature to disturb others by sending continuous messages. So how do i stop this. I want them to send push notification to their friend 3 times in 2 hours or so. Also number of notifications should be 3/2hrs per friend. After 2hrs this counter should reset. Please note i am using cloud script for sending Notifications.

CloudScriptPush NotificationsFriendsPlayer Inventory
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

You could do this a few ways, but the simplest would be to just save their "call to play" requests in a key/value pair in player read only or internal data (since you have to do the Push via Cloud Script anyway, you should make the data secure). Just save a timestamp and PlayFab ID pair for each request, and when they try to make a new one, you can check if they're overusing it, and then either return an error or send it and add that info to the saved data (removing any that are past the two hour mark).

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.