fredriksthlm Posted September 3, 2019 Share Posted September 3, 2019 Hi, I know every entry in the leaderboards are saved with a timestamp (since it is possible to delete entries made before a certain date with resetLeaderboards, and you can also call getTimeStamp for a score). But is it possible to fetch leaderboard data with date/timestamp limit? Like to request "Highest of the month" or similar. So basically to use the normal getLeaderboardAsync function, but with a timestamp filter. That would be a good thing since we have this issue that players name will be changed into "Player" after 3months inactivity... Quote Link to comment Share on other sites More sharing options...
b10b Posted September 3, 2019 Share Posted September 3, 2019 3 hours ago, fredriksthlm said: But is it possible to fetch leaderboard data with date/timestamp limit? Like to request "Highest of the month" or similar. So basically to use the normal getLeaderboardAsync function, but with a timestamp filter. That would be a good thing since we have this issue that players name will be changed into "Player" after 3months inactivity... It is possible, but it's perhaps a little "back-to-front" to what you describe? There are a few approaches that can work (given the mid-2019 API): Create a new Leaderboard each month. Use it for that month only - have your game connect to it using a naming convention that includes date / month. Use a single Leaderboard for all months. Entirely reset that Leaderboard each month (or delete entries which are older than the current month's start date). Use a proprietary backend and synchronise Leaderboard entries. This will theoretically allow you to filter limit and offset ranges on the getLeaderboardAsync method based on relative dates (complex and not entirely without other issues!). For more information see: https://developers.facebook.com/docs/games/instant-games/guides/using-leaderboards In particular the references to the Facebook Graph APIs are what you need: https://developers.facebook.com/docs/graph-api/reference/application/leaderboards_create/ https://developers.facebook.com/docs/graph-api/reference/application/leaderboards_reset/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.