- Home /
Implement Facebook Leaderboards for iOS/Android
Hi,
I've been using Unity for several months now. I taken a look at the Facebook SDK, and been wondering what is the best way to implement Facebook Leaderboards.
I have an app, let's call it "Flappy Bird" for the sake of this example. I have Flappy Bird on iOS (Apple App Store) and Android (Google Play). I want both of them to have the same leaderboard table.
Users on either iOS or Android would see the same global Facebook leaderboard. They can also view their "friends" leaderboard - a leaderboard consisting of their friends scores.
Where should I store these scores? I can't store them on the Game Center, because that's iOS specific (it won't support Android), because I want a leaderboard with the same hiscores for the two platforms. I could store it in a MySQL database on my server? Firebase looks too expensive for me.
On my MySQL database, I would have a table with columns: application_id, user_id (would be the user's Facebook ID), display_name, score.
Would this be a good design? Then in Unity, I would use JSON or a HTTP GET REQUEST to obtain the leaderboards and a HTTP POST REQUEST to set their score (slightly insecure but that's fine).
What are the best practices? I have never made a leaderboard before, but I see Google Play Services and Game Center, but these leaderboards are not platform independent, neither do they allow a "Facebook" friends leaderboard.
Thanks!