unity-solutions icon indicating copy to clipboard operation
unity-solutions copied to clipboard

Friends-only leaderboard

Open dzlier-gcp opened this issue 6 years ago • 2 comments

Original Google Groups message

I'd love it if the leaderboard implementation had optional integrations for Facebook, Twitter, and/or Phone Number to support a friends-list style leaderboard. It's one of the trickiest problems I've had to solve in my code, and I often end up rewriting it on each new game I create.

dzlier-gcp avatar Jun 29 '18 21:06 dzlier-gcp

Thanks for posting my request!

As a bit of added context, I think the biggest complication to solve here is the multi-stage nature of the coordination between Firebase and e.g. Facebook:

  • Fetching the list of friend ids from facebook (I wish they hadn't ditched their scores API)
  • Coordinating that to a filtered fetch from Firebase to populate the realtime scores, and
  • Concurrently firing off an avatar fetch for each user.

I've gotten something that mostly works by coalescing a bunch of tasks together, but it's dicy and very prone to edge cases.

p.s. - I may be able to free up some time to contribute here if you're open to PRs

asarazan avatar Jun 30 '18 18:06 asarazan

Yeah we are open to PR's! I will add a CONTRIBUTING.md file with details about Google's OSS policy. If you want to take this issue feel free, otherwise I can triage it when I get back in the office after holidays. We are also starting work on the next project for this directory, which I might announce soon :)

dzlier-gcp avatar Jul 01 '18 18:07 dzlier-gcp