I have made a gaming app, and published it on google store and I have added google achievement xp to my app, but there is no guide on internet that I can find that should add player's earned xp on the google play game profile and also it(google game app) not showing achievements and xp it only shows the leaderboard.
Here is my code :-
void giveAchievements(int counter) {
if (counter == 10) {
int xp = getXp();
xp += 500;
saveXp(xp);
if(getApiClient().isConnected()) {
Games.Achievements.unlock(getApiClient(), getString(R.string.achievement_first_10_clicks));
Games.Leaderboards.submitScoreImmediate(getApiClient(), "CgkI- eXOwZsFEAIQBg", counter);
}
}
}
private int getXp() {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
return sharedPref.getInt("xp", 0);
}
private void saveXp(int xp) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("xp", xp);
editor.apply();
}
Here is the image of achievements inside my app
And here in the google play profile the xp doesn't add to the profile and also here the app's achievements section is not showing:-