1.Introduction
Description: Extension to create/modify files (DRIVE_FILE
and DRIVE_APPDATA
scope) in user's drive
Latest Version: 2
Released: 2021-07-27T18:30:00Z
Last Updated: 2023-06-11T18:30:00Z
Permissions: android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE,android.permission.GET_ACCOUNTS,android.permission.MANAGE_ACCOUNTS
Note: You may not need to ask any of the above permission
2.Blocks
3.Documentation
Expand
AuthFailed
Event invoked when authentication fails and returns the error message
errorMessage | text
AuthSuccess
Event indicating that authentication was successful and returns the necessary credentials
displayName | text
email | text
photoUrl | text
FileCreated
Event invoked after creating empty file
fileId | text
FileDeleted
Event invoked after 'DeleteFile' method with result which will be either true(boolean) or the error message
result | text
FileDownloaded
Event indicating that file has been downloaded and returns the file's path
filePath | text
FileMoved
Event invoked after MoveFile method and provides result
result | text
FileUpdated
Event indicating that file has been updated and returns the file's id
fileId | text
FileUploaded
Event indicating that file has been uploaded and returns the file's id
fileId | text
FolderCreated
Event invoked after creating folder and returns the newly created foder's id
folderId | text
GotError
Event invoked in most of cases when an error occurs and provides the error message
errorMessage | text
GotFileInfo
Event invoked after getting file's info as a dictionary
infoDictionary | dictionary
Dictionary Keys: parents,owners,permissions,version,trashed,starred,ownedByMe,id,name,description,kind,webViewLink,webContentLink,size,mimeType,fileExtension,modifiedTime,shared,sharingUser,createdTime
Sample Output
{
"kind": "drive#file",
"id": "1eHunzBVWS1okewLmUElfr6oF1QPiUk7e",
"name": "easy.apk",
"mimeType": "application/vnd.android.package-archive",
"description": "test",
"starred": false,
"trashed": false,
"parents": [
"0AH-7gLQd43BJUk9PVA"
],
"version": "35",
"webContentLink": "https://drive.google.com/uc?id=1eHunzBVWS1okewLmUElfr6oF1QPiUk7e&export=download",
"webViewLink": "https://drive.google.com/file/d/1eHunzBVWS1okewLmUElfr6oF1QPiUk7e/view?usp=drivesdk",
"createdTime": "2021-05-27T14:01:57.987Z",
"modifiedTime": "2021-06-17T11:56:07.794Z",
"owners": [
{
"kind": "drive#user",
"displayName": "Sunny Gupta",
"photoLink": "https://lh3.googleusercontent.com/a-/AOh14GhHVb165y2-o5n-p5d7Ifybm0FHYv7VF5ZXxm0Y=s64",
"me": true,
"permissionId": "09685196566119801289",
"emailAddress": "vknow360@gmail.com"
}
],
"shared": true,
"ownedByMe": true,
"permissions": [
{
"kind": "drive#permission",
"id": "anyoneWithLink",
"type": "anyone",
"role": "reader",
"allowFileDiscovery": false
},
{
"kind": "drive#permission",
"id": "09685196566119801289",
"type": "user",
"emailAddress": "vknow360@gmail.com",
"role": "owner",
"displayName": "Sunny Gupta",
"photoLink": "https://lh3.googleusercontent.com/a-/AOh14GhHVb165y2-o5n-p5d7Ifybm0FHYv7VF5ZXxm0Y=s64",
"deleted": false
}
],
"fileExtension": "apk",
"size": "3476278"
}
GotFilesList
Event invoked after getting files list which is a dictionary having file name as key and id as value
files | dictionary
OwnershipTransferred
Event invoked after transferring ownership
ownerEmail | text
PermissionCreated
Event invoked after creating permission and provides permission Id which can be used to update it
permissionId | text
PermissionDeleted
Event invoked after deleting permission
fileId | text
PermissionUpdated
Event invoked after updating permission
permissionId | text
CreateEmptyFile
Creates an empty file in root folder
CreateFolder
Creates folder in parent folder (Root folder if set to empty)
parentId | text
folderName | text
CreatePermission
Creates permission for specific file for give user
fileId | text
permissionDictionary | dictionary
DeleteFile
Deletes the specified file
fileId | text
DeletePermission
Revokes permission provided earlier
fileId | text
permissionId | text
DownloadFile
Downloads specified file to the given path
fileId | text
downloadPath | text
GetFileInfo
Gets info of given folder/file from its id
fileId | text
IsAuthorized
Returns whether user has signed in and granted access or not.
It must be called before using any other method except LaunchAuthFlow.
Return type : boolean
LaunchAuthFlow
Launches auth flow to get access from user
ListFiles
Lists files present in specified folder with given filter i.e. includeFolders
folderId | text
includeFolders | boolean
MoveFile
Tries to move file from one folder to another folder
fileId | text
fromFolderId | text
toFolderId | text
RevokeAccess
Revokes access and signs out the user
SignOut
Signs out the user from app
TransferOwnership
Transfers file's ownership to given (user) email address
fileId | text
newOwnerEmail | text
UpdateFile
Tries to update the already existing file
fileId | text
newFilePath | text
newMetadata | dictionary
UpdatePermission
Updates permissions of a specific user for given file
fileId | text
permissionId | text
permissionDictionary | dictionary
UploadFile
Uploads files to specified folder,if folderId is empty then uploads to root of app data folder
folderId | text
filePath | text
AppDataScope
Grants access to App Data Folder in drive
Property Type : read-only
Accepts : text
FileScope
Grants access to files created using this extension/app
Property Type : read-only
Accepts : text
SetScope
Sets Scope to be asked to user to grant access
Property Type : write-only
Accepts : text
AuthFailed
Event invoked when authentication fails and returns the error message
errorMessage | text
AuthSuccess
Event indicating that authentication was successful and returns the necessary credentials
displayName | text
email | text
photoUrl | text
FileCreated
Event invoked after creating empty file
fileId | text
FileDeleted
Event invoked after 'DeleteFile' method with result which will be either true(boolean) or the error message
result | text
FileDownloaded
Event indicating that file has been downloaded and returns the file's path
filePath | text
FileMoved
Event invoked after MoveFile method and provides result
result | text
FileUpdated
Event indicating that file has been updated and returns the file's id
fileId | text
FileUploaded
Event indicating that file has been uploaded and returns the file's id
fileId | text
FolderCreated
Event invoked after creating folder and returns the newly created foder's id
folderId | text
GotError
Event invoked in most of cases when an error occurs and provides the error message
errorMessage | text
GotFileInfo
Event invoked after getting file's info as a dictionary
infoDictionary | dictionary
GotFilesList
Event invoked after getting files list which is a dictionary having file name as key and id as value
files | dictionary
OwnershipTransferred
Event invoked after transferring ownership
ownerEmail | text
PermissionCreated
Event invoked after creating permission and provides permission Id which can be used to update it
permissionId | text
PermissionDeleted
Event invoked after deleting permission
fileId | text
PermissionUpdated
Event invoked after updating permission
permissionId | text
CreateEmptyFile
Creates an empty file in root folder
CreateFolder
Creates folder in parent folder (Root folder if set to empty)
parentId | text
folderName | text
CreatePermission
Creates permission for specific file for give user
fileId | text
permissionDictionary | dictionary
DeleteFile
Deletes the specified file
fileId | text
DeletePermission
Revokes permission provided earlier
fileId | text
permissionId | text
DownloadFile
Downloads specified file to the given path
fileId | text
downloadPath | text
GetFileInfo
Gets info of given folder/file from its id
fileId | text
IsAuthorized
Returns whether user has signed in and granted access or not.
It must be called before using any other method except LaunchAuthFlow.
Return type : boolean
LaunchAuthFlow
Launches auth flow to get access from user
ListFiles
Lists files present in specified folder with given filter i.e. includeFolders
folderId | text
includeFolders | boolean
MoveFile
Tries to move file from one folder to another folder
fileId | text
fromFolderId | text
toFolderId | text
RevokeAccess
Revokes access and signs out the user
SignOut
Signs out the user from app
TransferOwnership
Transfers file's ownership to given (user) email address
fileId | text
newOwnerEmail | text
UpdateFile
Tries to update the already existing file
fileId | text
newFilePath | text
newMetadata | dictionary
UpdatePermission
Updates permissions of a specific user for given file
fileId | text
permissionId | text
permissionDictionary | dictionary
UploadFile
Uploads files to specified folder,if folderId is empty then uploads to root of app data folder
folderId | text
filePath | text
AppDataScope
Grants access to App Data Folder in drive
Property Type : read-only
Accepts : text
FileScope
Grants access to files created using this extension/app
Property Type : read-only
Accepts : text
SetScope
Sets Scope to be asked to user to grant access
Property Type : write-only
Accepts : text
4.Buy/Donate
Kindly PM me.
You can learn more about functionality of extension here:
Since both extensions share same base so it is obviously safe to use both of them because Google is still watching out everything.
You can do this now.
Hope it helps!