Transcendental
Transcendental

Reputation: 981

Android - score not being submitted to a leaderboard

Recently, I've added leaderboards to my Android project and everything worked fine until I tried to submit score to it. Google Play Services are configured correctly and I can view the leaderboard but I cannot submit

 Games.Leaderboards.submitScoreImmediate(getApiClient(),String.valueOf(R.string.leaderboard_id), score);   

Since i doubt error is visibe from that line and since logcat displays no data related to score submission, i am wondering how to check is the score was submitted correctly. Thanks.

Upvotes: 0

Views: 612

Answers (1)

Simon Meyer
Simon Meyer

Reputation: 2044

I don't know much about the score submission to the Leaderboards - but the error might be visible from your line:

String.valueOf(R.string.leaderboard_id) 

is not giving you the string you specified in the some strings.xml file, but some string containing the internal android id for that String like "1234567". To get the String from the file you should use

getContext().getString(R.string.leaderboard_id)

Upvotes: 1

Related Questions