I'm using the new Google Drive Android API. This is the demo code that I've copied from Google's android-samples repo.
GoogleSignInAccount signInAccount = GoogleSignIn.getLastSignedInAccount(this);
if (signInAccount != null && signInAccount.getGrantedScopes().containsAll(requiredScopes)) {
initializeDriveClient(signInAccount);
}
else
{ ... }
The issue I'm facing is, even if I remove the app from Drive, getLastSignedInAccount()
is still returning the account and the operations (such as adding a file) on the accounts are still succeeding. Returning the GoogleSignInAccount
object is fine, I suppose, but it should not allow the operations on it. I double checked in Drive, there are no files getting added when the API returns success (since I've unlinked the app). What is going wrong here?
And yes it worked when I manually synced the account on my device. In that case, though getLastSignedInAccount()
returned the object, the operations did fail.
PS: I'm requesting SCOPE_FILE
and SCOPE_APPFOLDER
scopes.