I am having trouble with Android TV and the integration with Google Sign-In. I have an app that accesses Google Drive to download and render user content from their Google Drive.
First, a bit about the process of integrating Google Sign-In inside Android TV: Initially, the app was using GoogleSignIn, something like:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(new Scope(DRIVE_SCOPE))
.requestEmail()
.build();
GoogleSignInClient googleSignInClient = GoogleSignIn.getClient(this, gso);
startActivityForResult(googleSignInClient.getSignInIntent(), SIGN_IN);
That mostly works. I get the user picker, and if it is the first time, I get the consent screens:
That worked for some time, but suddenly the newly logged-in users started to have issues. Some days after the login (a few days later), the app starts getting code 12500 when trying to start an OAuth session without much information. Revoking and logging in again does not help. The only solution I found was to factory reset the Android TV unit (Nvidia SHIELD) and then log in again. Then again, it works for a few days. I have one user with a Nvidia Shield that was logged in some years ago and is still working without any issue nowadays, but the same code seems to be failing with newly created users. Anyway, I thought that before reporting that, I must upgrade my app to use the latest AuthorizationRequest flow and see if that fixes my issue.
The issue:
AuthorizationRequest seems to be working (still have a few days to go to see if the user stays connected), but I realize that the user picker was changed and that I don't get the user consent request view with this version. I built a new app from scratch just to be sure that it was not already approved, and I still don't get the consent screen. The only thing I see is the picker:
Is this right? Where is the consent screen? I need it to go through the OAuth verification process in Google Cloud, and the user also needs to consent.
Also, I couldn't find any way to revoke and log out from one account.
Summing up:
After some months without finding a solution from Google, we decided to stop using Google Drive in our Android TV apps and switch to Microsoft OneDrive.