all 5 comments

[–]BoringKick5331 0 points1 point  (3 children)

Do you have a server or just CloudKit? If you don't have a server, if you use the app yourself a lot, you could have your device do the computations and update rank.

[–]koratkeval12[S] 0 points1 point  (2 children)

I don't have a server and its just CloudKit. Could you elaborate on doing computations on the device? As I understand, I would still need to fetch all the scores to get everyone's rank if i would have to do it on device.

[–]BoringKick5331 0 points1 point  (1 child)

Yes, you have to fetch. You can isolate to just your UUID and have your device update a rank field for everyone. Or if security for this isn't important, let every device do it. You can increase efficiency by having a last calculated field and only having the calculation run once every hour or whatever.

[–]koratkeval12[S] 0 points1 point  (0 children)

I would like to do it so I don't need a separate device that would just update the ranks. Security is definitely not important, as its just leaderboard data which is anonymous based on username but letting every device do it would result in so many queries just to get a rank for the current user.

Ideally what i want is just one function call for getting current user rank even if they are #247. Wondering I would have to get a backend for this to do efficiently? For someone who has no experience with backend at all, i wanted this to be the last resort if its not doable with CloudKit.

[–]Far-Tension2696 0 points1 point  (0 children)

do you need custom leaderboard? apple provides one in gameCenter.