FirebaseExtended / unity-solutions

Use Firebase tools to incorporate common features into your games!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Friends-only leaderboard

dzlier-gcp opened this issue · 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.

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

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 :)