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: 2021-07-27T18:30:00Z
Last Updated: 2021-07-27T18: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

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
{
 "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
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:

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:

6 Likes