Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google+ Share Stopped working

I have an android app and I'm implementing share following these instructions.

I manage to get it working. I came back to it the next day and I get this output in logcat:

 G+ on connection failed ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{422d8470: android.os.BinderProxy@422d8410}}

I have triple checked the api console, removed my OAuth clientID and input again fresh. This has not fixed it. Any idea about what I can look into to fix it?

like image 605
serenskye Avatar asked May 28 '13 09:05

serenskye


People also ask

Why is Google sharing not working?

There may be many reasons behind this issue, including Windows firewall and antivirus software, administrative permissions, incorrect program installation, Internet connection, etc. Before troubleshooting, you need to make sure you know how to change Google Drive sharing settings properly.

Why is Google Drive not letting me share?

If the folder you want to share with anyone on the link is owned within a G Suite account, you need to "Set Drive users' sharing permissions" to allow all the users to share folders to non-gmail account. Note: If the folders are in a shared drive, non-Google account cannot be added to the Shared drive.

Why is my shared Google Drive not updating?

If you sync changes to a file you don't own and the owner doesn't have enough storage, the changes won't sync. To sync changes, reach out to the file owner to either transfer ownership or ask them to manage their storage. If you don't have enough local storage, free up space.


1 Answers

You can get the SIGN_IN_REQUIRED connection result for a number of reasons, eg.:

  • if you call PlusClient.clearDefaultAccount();.
  • if you disconnect the app either on http://plus.google.com/apps or by calling PlusClient.revokeAccessAndDisconnect();.
  • if your app requests authorization scopes in addition to those requested previously.

For SIGN_IN_REQUIRED, the ConnectionResult you receive contains a PendingIntent which can be used to resolve the issue. In the sample at the instructions you're following the example code handles the error in onConnectionFailed with the following code:

@Override
public void onConnectionFailed(ConnectionResult result) {
    if (result.hasResolution()) {
        try {
            result.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
        } catch (SendIntentException e) {
            mPlusClient.connect();
        }
    }
    // Save the result and resolve the connection failure upon a user click.
    mConnectionResult = result;
}

result.startResolutionForResult() will display an account chooser or the permissions dialog to resolve the issues mentioned above, and return control to onActivityResult, eg:

@Override
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
    if (requestCode == REQUEST_CODE_RESOLVE_ERR && responseCode == RESULT_OK) {
        mConnectionResult = null;
        mPlusClient.connect();
    }
}

At this point the call to PlusClient.connect() should succeed.

like image 195
Lee Avatar answered Nov 07 '22 12:11

Lee