To be added
To show the google sign in screen.
GamesServices.signIn();
To silently sign in.
GamesServices.silentSignIn();
To show the achievements screen.
GamesServices.showAchievements();
To show the leaderboards screen.
GamesServices.showLeaderboards(leaderboardID: "ios_leaderboard_id");
note: You need to pass the leaderboard id for iOS, for android it's not required.
To submit a score to specific leaderboard.
GamesServices.submitScore(leaderboardID: 'leader_board_id', score: score);
note: You need to pass the leaderboard id for iOS in case of iOS and the leaderboard id for android in case of android.
To unlock an achievement.
GamesServices.unlock(achievementID: 'achievement_id', percentComplete: 0);
note: You need to pass the achievement id for iOS in case of iOS and the achievement id for android in case of android.
the percentComplete
is required in case of iOS but not android.
Simply add the following line to your pubspec.yaml file:
dependencies:
games_services: any # <-- Add this line