ultimate
ultimate

Reputation: 727

google leaderboard failed to submit scores

I am implementing Google Play game services and use leader board for submitting scores. It permits to sign in to google plus but not display submitted scores through submitScore(leaderboard_id, score) and display 0 player while I am already signed in with test account. I checked in both ready to publish and published mode of leader board. I checked in OnScoreSubmittedListener, it fails with STATUS_NETWORK_ERROR_OPERATION_FAILED.

public void onsubmitscore(View view){
    getGamesClient().submitScoreImmediate(new OnScoreSubmittedListener() {

        @Override
        public void onScoreSubmitted(int arg0, SubmitScoreResult arg1) {
            // TODO Auto-generated method stub
            Toast.makeText(MainActivity.this,  ""+arg1,Toast.LENGTH_LONG).show();
        }
    }, getString(R.string.leaderboard_hard), 39999);
}

i am able to share game link on google plus but it is displaying 0 player in circle without any score. please help me soon.

Upvotes: 2

Views: 3701

Answers (4)

user3774630
user3774630

Reputation: 266

Use

Games.Leaderboards.submitScoreImmediate(apiclient, leaderboardID, score);

I've been having the same issue; Achievements have been unlocked fine, Scores not so. Finally I looked at the google apis and this method seems to work.

Upvotes: 0

Dhruv
Dhruv

Reputation: 185

Although it may sound stupid but just to be sure...Are you submitting a score greater then the one you have configured on the console to be the min value for that leaderboard?

Upvotes: 2

Eliodorus
Eliodorus

Reputation: 109

Check the Testing item under Game Services for your game. Game Services appears to have its own set of test accounts independent of those set through Settings in the Developer Console.

With test accounts listed only in the Developer Console (i.e. not in Game Services), I can test a game itself as well as achievements. However, when testing leader boards I see the same error you report (STATUS_NETWORK_ERROR_OPERATION_FAILED). When I add the test accounts to Testing under Game Services, the error goes away and leader boards function properly.

There isn't really anything in the documentation that suggests this should happen, and the behavior is inconsistent (achievements work; leader boards don't).

Upvotes: 0

Abandoned Cart
Abandoned Cart

Reputation: 4676

There is a possibility you are not signed in when this error occurs. Make sure to perform some sort of check, such as getGamesClient.isConnected() or isSignedIn(). Usually, my procedure is to check both and respond accordingly.

Upvotes: 1

Related Questions