when a shared user is login in App. shared file can't access. API return "no files found'.
var SCOPES = ["https://www.googleapis.com/auth/drive.file", "profile"];
function createPermissions(fileId, body) {
gapi.client.load("drive", "v3", function() {
gapi.client.drive.permissions
.create({
fileId: fileId,
resource: body
})
.then(function(res) {
//console.log(res);
Swal.fire("Success!", "File has been success shared!", "success");
// do something
})
.catch(function(err) {
//console.log(err);
Swal.fire({
icon: "error",
title: "Oops...",
text: "Something went wrong! Plese try agian later!!",
footer: ""
});
// do something
});
});
}
The above code is working fine, the file is successfully shared but the shared user gets email notification of share file and when a shared user clicks on a shared file email file is access in google drive. Ie: Manoj (App owner) upload file in google APP(google drive API) and share file with "Rigal". Rigal gets a shared file email notification and file also display(access ) in his google drive. But when Rigal login in App (google drive API) he can't view (access) shared file. Thanks
https://www.googleapis.com/auth/drive? The documentation developers.google.com/identity/protocols/googlescopes specifies thathttps://www.googleapis.com/auth/drive.fileonly allows you to "View and manage Google Drive files and folders that you have opened or created with this app"