我的应用程序使用Firebase Auth进行身份验证(允许使用Facebook / Google / Email登录,并允许我拥有一个通用的UserID,无论他用于登录的这三个选项中的哪一个)。
我还使用Firebase实时数据库保存了一些用户数据。
我想将Leaderboard和Achievements添加到我的应用程序中。
我的疑问是:
我可以通过Firebase数据库中的“表格”手动添加排行榜和成就...但我可以使用Google Play游戏服务以任何方式执行此操作吗? (并通过Firebase Auth保持登录)。
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).
最满意答案
我认为有一个专门针对这个想法的完整文档。 检查将Firebase与Play游戏服务项目集成
在Google Play台中将Firebase添加到Play游戏服务项目后,您可以:
访问Google Analytics for Firebase,这是一款免费的应用衡量解决方案,可提供有关应用使用情况和用户参与度的深入见解。 通过将Play游戏事件记录到Firebase,在Google Analytics信息中心中查看您的游戏事件。 当您将Firebase添加到Play游戏服务项目时,您还将Google Play帐户与Firebase项目相关联。
解锁成就
Bundle bundle = new Bundle(); bundle.putString(FirebaseAnalytics.Param.ACHIEVEMENT_ID, achievementId); mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.UNLOCK_ACHIEVEMENT, bundle);排行榜上的得分
Bundle bundle = new Bundle(); bundle.putLong(FirebaseAnalytics.Param.SCORE, score); bundle.putString("leaderboard_id", leaderboardId); mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.POST_SCORE, bundle);您可以查看Google Analytics for Firebase信息中心中记录的事件。 您还可以通过点击游戏详细信息页面中应用图标旁边的Firebase图标直接从Play控制台访问Firebase控制台。
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.
更多推荐
发布评论