GDrive: Extended version of former GDrive extension [$15 or INR 1001]

1.Introduction

Description: Extension to create/modify files (DRIVE_FILE and DRIVE_APPDATA scope) in user’s drive
Latest Version: 1
Released: July 28,2021
Last Updated: July 28,2021

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

image

image

image

image

image

image

image

3.Documentation

AuthFailed

Event invoked when authentication fails and returns the error message

Params 

errorMessage | text


AuthSuccess

Event indicating that authentication was successful and returns the necessary credentials

Params 

displayName | text
email | text
photoUrl | text


FileCreated

Event invoked after creating empty file

Params 

fileId | text


FileDeleted

Event invoked after ‘DeleteFile’ method with result which will be either true(boolean) or the error message

Params 

result | text


FileDownloaded

Event indicating that file has been downloaded and returns the file’s path

Params 

filePath | text


FileMoved

Event invoked after MoveFile method and provides result

Params 

result | text


FileUpdated

Event indicating that file has been updated and returns the file’s id

Params 

fileId | text


FileUploaded

Event indicating that file has been uploaded and returns the file’s id

Params 

fileId | text


FolderCreated

Event invoked after creating folder and returns the newly created foder’s id

Params 

folderId | text


GotError

Event invoked in most of cases when an error occurs and provides the error message

Params 

errorMessage | text


GotFileInfo

Event invoked after getting file’s info as a dictionary

Params 

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

GotFilesList

Event invoked after getting files list which is a dictionary having file name as key and id as value

Params 

files | dictionary


OwnershipTransferred

Event invoked after transferring ownership

Params 

ownerEmail | text


PermissionCreated

Event invoked after creating permission and provides permission Id which can be used to update it

Params 

permissionId | text


PermissionDeleted

Event invoked after deleting permission

Params 

fileId | text


PermissionUpdated

Event invoked after updating permission

Params 

permissionId | text


CreateEmptyFile

Creates an empty file in root folder


CreateFolder

Creates folder in parent folder (Root folder if set to empty)

Params 

parentId | text

folderName | text


CreatePermission

Creates permission for specific file for give user

Params 

fileId | text

permissionDictionary | dictionary


DeleteFile

Deletes the specified file

Params 

fileId | text


DeletePermission

Revokes permission provided earlier

Params 

fileId | text

permissionId | text


DownloadFile

Downloads specified file to the given path

Params 

fileId | text

downloadPath | text


GetFileInfo

Gets info of given folder/file from its id

Params 

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

Params 

folderId | text

includeFolders | boolean


MoveFile

Tries to move file from one folder to another folder

Params 

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

Params 

fileId | text

newOwnerEmail | text


UpdateFile

Tries to update the already existing file

Params 

fileId | text

newFilePath | text

newMetadata | dictionary


UpdatePermission

Updates permissions of a specific user for given file

Params 

fileId | text

permissionId | text

permissionDictionary | dictionary


UploadFile

Uploads files to specified folder,if folderId is empty then uploads to root of app data folder

Params 

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

Params 

errorMessage | text


AuthSuccess

Event indicating that authentication was successful and returns the necessary credentials

Params 

displayName | text
email | text
photoUrl | text


FileCreated

Event invoked after creating empty file

Params 

fileId | text


FileDeleted

Event invoked after ‘DeleteFile’ method with result which will be either true(boolean) or the error message

Params 

result | text


FileDownloaded

Event indicating that file has been downloaded and returns the file’s path

Params 

filePath | text


FileMoved

Event invoked after MoveFile method and provides result

Params 

result | text


FileUpdated

Event indicating that file has been updated and returns the file’s id

Params 

fileId | text


FileUploaded

Event indicating that file has been uploaded and returns the file’s id

Params 

fileId | text


FolderCreated

Event invoked after creating folder and returns the newly created foder’s id

Params 

folderId | text


GotError

Event invoked in most of cases when an error occurs and provides the error message

Params 

errorMessage | text


GotFileInfo

Event invoked after getting file’s info as a dictionary

Params 

infoDictionary | dictionary


GotFilesList

Event invoked after getting files list which is a dictionary having file name as key and id as value

Params 

files | dictionary


OwnershipTransferred

Event invoked after transferring ownership

Params 

ownerEmail | text


PermissionCreated

Event invoked after creating permission and provides permission Id which can be used to update it

Params 

permissionId | text


PermissionDeleted

Event invoked after deleting permission

Params 

fileId | text


PermissionUpdated

Event invoked after updating permission

Params 

permissionId | text


CreateEmptyFile

Creates an empty file in root folder


CreateFolder

Creates folder in parent folder (Root folder if set to empty)

Params 

parentId | text

folderName | text


CreatePermission

Creates permission for specific file for give user

Params 

fileId | text

permissionDictionary | dictionary


DeleteFile

Deletes the specified file

Params 

fileId | text


DeletePermission

Revokes permission provided earlier

Params 

fileId | text

permissionId | text


DownloadFile

Downloads specified file to the given path

Params 

fileId | text

downloadPath | text


GetFileInfo

Gets info of given folder/file from its id

Params 

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

Params 

folderId | text

includeFolders | boolean


MoveFile

Tries to move file from one folder to another folder

Params 

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

Params 

fileId | text

newOwnerEmail | text


UpdateFile

Tries to update the already existing file

Params 

fileId | text

newFilePath | text

newMetadata | dictionary


UpdatePermission

Updates permissions of a specific user for given file

Params 

fileId | text

permissionId | text

permissionDictionary | dictionary


UploadFile

Uploads files to specified folder,if folderId is empty then uploads to root of app data folder

Params 

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. :heart:

You can learn more about functionality of extension here:

https://community.appinventor.mit.edu/t/paid-gdrive-just-a-google-drive-app-data-folder-extension-8-or-inr-551/35643

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! :slightly_smiling_face:

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments