Android Google Drive REST Api: List Files Return Empty Results (does not return all files)

When request google drive permission scope, DriveScopes.DRIVE_FILE only return files created/opened by the app. To return all files, use DriveScopes.DRIVE, DriveScopes.DRIVE_READONLY or DriveScopes.DRIVE_METADATA_READONLY

private fun buildGoogleSignInClient(): GoogleSignInClient {    val signInOptions = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)        // .requestScopes(Scope(DriveScopes.DRIVE_FILE))        .requestScopes(Scope(DriveScopes.DRIVE))        // .requestScopes(Scope(DriveScopes.DRIVE_METADATA_READONLY))        .build()    return GoogleSignIn.getClient(this, signInOptions)}


❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.