question

kilosoft avatar image
kilosoft asked

How to get the position (rank) of the leaderboard when you reset the leaderboard. And send a notification with rank?

How to get the position (rank) of the leaderboard when you reset the leaderboard. And send a notification with rank?

CloudScriptPush NotificationsLeaderboards and Statistics
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.

jital avatar image jital ♦ commented ·

Greetings,

Could you provide more details on how you're attempting to implement? When Leaderboards are reset they contain no rankings, so this notification to the player would not contain any information.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

I am not sure how will you reset your leaderboard but if you want to retrieve the last version of leaderboard, you may make use of the UseSpecificVersion and Version properties in the leaderboard retrieval related API call requests, like GetLeaderboard, GetLeaderboardAroundPlayer and etc.

For Essential Tier users, you may notice that only the last version of leaderboard is available to retrieve. You can implement cloud script functions that will call GetLeaderboardAroundPlayer to get the rank and then send it via SendPushNotification API calls. In addition, you can configure a Scheduled Task to run this functions to each member in All Players segment.

By the way, there is a programmatical way to reset the leaderboard but it is only included in Admin API which means, you cannot reset leaderboard in Cloud Script, instead you may implement it in your external secure server. However, like what @jital has mentioned, if you tell us more about your scenario, we can offer more help.

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.