0

I have this issue:

GoogleApiClient.ConnectionCallbacks methods not being called after connecting to the GoogleApiClient

But the callbacks have been added but still no onConnection callback and no errors why would that be? Can anyone help?

My code:

public class MainActivity extends Activity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { private GoogleApiClient mGoogleApiClient ;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initGoogleApiClient();
}

private void initGoogleApiClient() {
       mGoogleApiClient = new GoogleApiClient.Builder( this )
       .addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
       .addApi(Games.API).addScope(Games.SCOPE_GAMES)
       .addConnectionCallbacks(this)
       .addOnConnectionFailedListener(this)
       .build();

       mGoogleApiClient.connect();    
}
@Override
public void onConnected(Bundle bundle) {
}

@Override
public void onConnectionSuspended(int i) {
}

@Override
protected void onDestroy() {
    super.onDestroy();
    mGoogleApiClient.disconnect();
}

@Override
public void onConnectionFailed(com.google.android.gms.common.ConnectionResult connectionResult) {
}
Community
  • 1
  • 1

2 Answers2

0

I'll answer my own question - again. The answer is to do with setting up the developer console with a debug key:

https://developers.google.com/games/services/console/enabling#a_create_a_linked_application

I can’t find the Android keytool

How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android?

Community
  • 1
  • 1
  • Ok so it still doesn't work. Can someone tell me do I have to 'publish' the achievements before they work? – user3725725 Jun 07 '15 at 11:28
  • I'm getting logins registered in the developer console, but I'm not getting a onConnection due to the app not being configured?! The email accounts I'm using are set as tester accounts. Why would this not be working now? Help! – user3725725 Jun 07 '15 at 11:35
0

It's ok I've done it! Apparently you can't just debug you app from Eclipse you have to install it with an APK otherwise it wont work. As described here:

https://developers.google.com/games/services/android/quickstart

Good luck to anyone else wading through all the fantastic Google documentation.

:-S