3
votes

My application is using Firebase Auth for authentication (allowing login with Facebook / Google / Email, and allowing me to have a common UserID regardless of which of these three options he used for login).

I also saved some user data using Firebase Realtime Database.

I want to add Leaderboard and Achievements to my application.

My doubt is:

I could add Leaderboard and Achievements manually via "tables" in Firebase Database... But can I do this in any way using Google Play Games Services? (and keeping login by Firebase Auth).

1

1 Answers

1
votes

I think there's an entire documentation dedicated to that idea. Check Integrate Firebase with Your Play Games Services Project

When you add Firebase to your Play Game Services project in the Google Play Console, you can:

Get access to Google Analytics for Firebase, a free app measurement solution that provides insight on app usage and user engagement. View your Games events in the Analytics dashboard by logging Play Games events to Firebase. When you add Firebase to your Play Games Services project, you’re also linking your Google Play Account to your Firebase project.

Unlock achievements

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ACHIEVEMENT_ID, achievementId);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.UNLOCK_ACHIEVEMENT, bundle);

Scores on a leaderboard

Bundle bundle = new Bundle();
bundle.putLong(FirebaseAnalytics.Param.SCORE, score);
bundle.putString("leaderboard_id", leaderboardId);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.POST_SCORE, bundle);

You can view the events logged in the Google Analytics for Firebase dashboard. You can also access the Firebase console directly from the Play Console by clicking the Firebase icon next to your app’s icon in the Game details page.