I'm trying to use GPS for leaderboards for a few days without success. Developing using Eclipse and cocos2d-x.
After doing miles of preparations, importing 3rd party libraries and copy/pasting code from a sample project, I'm still left with errors and questions. I'm an iOS dev forced to do Android/GPS dev for a while so bear with me. (I'm an iOS user as well, I do not use Android. I might not have enough knowledge of Google world terminology.)
- To use GPS for leaderboards, do I have to implement Google+ functionality into the app?
- The specific error I get to
onConnectionFailed()
when trying to connect theGoogleApiClient
instance is: "SIGN_IN_REQUIRED". What does "sign in" mean - sign in to where? Sign in to Google Play Services? Sign in to Google+? Is either fine? Why does a "connect" call to GoogleApiClient not automatically launch some sign in procedure should it be necessary? How do I force the app to show some sign in UI to the user, or at least force the app to try to use the current Google account of the device?
Some instructions I've used are:
https://developers.google.com/games/services/android/leaderboards https://developers.google.com/android/guides/setup https://github.com/playgameservices/android-basic-samples (Using BaseGameUtils as dependency library)
mGoogleApiClient.isConnected()
returns false so can't proceed there. – Jonnyresult.startResolutionForResult(this, REQUEST_RESOLVE_ERROR);
did nothing unless I copied a file from the sample project: res/layout/activity_main.xml and ransetContentView(R.layout.activity_main);
insideonCreate()
- it finally brought up an account selection UI - however selecting an account there just leaves the app in a state from which it does not proceed. TheonActivityResult()
is the last point which is called at this state, it ends with a resultCode of 1001, which is not the expectedRESULT_OK
needed for a successfulconnect()
call. – Jonny