I have google plus login configured for an application via GoogleApiClient .
Whenever the application is installed for the first time and tries to make a connection through GoogleApiClient , it never becomes successful and always ends with onConnectionFailed with the result containing:
ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{4130e760: android.os.BinderProxy@4130e700 }}
But when you re- onConnected system, his name becomes successful and onConnected hits. Why is it possible to make it successful on the first try?
Is there something wrong with my Builder options?
public void connectGoogleApi() { mGoogleApiClient = new GoogleApiClient.Builder(mainAppContext).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build(); mGoogleApiClient.connect(); } public void onConnectionFailed(ConnectionResult result) { if (!result.hasResolution()) { GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), this, 0).show(); return; } if (!mIntentInProgress) {
android google-api-client
Maven
source share