I have created a public folder using aaa@gmail.com account. The shared folder is visible to anyone even without signing in, and has edit permissions to all ("Anyone on the Internet can find and access. No sign-in required." and anyone "Can organize, add, & edit")
I am using Drive API for Android to upload files to this folder.
OutputStream outputStream = driveContents.getOutputStream();
Writer writer = new OutputStreamWriter(outputStream);
writer.write("<Stuff...>");
writer.close();
MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
.setTitle(fileName)
.setMimeType(mimeType)
.setStarred(true).build();
DriveId id = DriveId.decodeFromString("<SharedFolderID>");
Drive.DriveApi.getFolder(driveApiClient, id)
.createFile(driveApiClient, changeSet, driveContents)
.setResultCallback(fileCallback);
When I use aaa@gmail.com to upload the files, it succeeds. But when I share the app with my friend and he tries to upload using bbb@gmail.com, there is an error and he cannot upload files. He gets "Invalid parent folder" error.
Do I need to change something in my code / google api portal / anywhere else so that I am able to upload files to the publicly shared folder using any account?
Thanks a lot in advance!