clientId: The client ID for the Google Drive integration. Obtained from Google Cloud Console.backupOption: An option from theGDriveBackupOptionenum that specifies the backup/recover storage type:.appDataFolder: Stores backups in the hidden, app-specific “App Data Folder” in Google Drive. This folder is not visible to the user..appDataFolderWithFallback: Attempts to store backups and recover using the “App Data Folder”. If recovery fails, it automatically falls back to a user-visible Google Drive folder..gdriveFolder(folderName: String): Stores backups in a user-visible folder in Google Drive with the specifiedfolderName.
- The
appDataFolderandappDataFolderWithFallbackoptions are supported starting from SDK version 4.2.0 - Those options cannot be used with an earlier SDK version, backups stored in the App Data Folder will be lost
- Choose the appropriate backup option based on your application’s requirements:
- Use
appDataFolderto keep wallet backups hidden from users (recommended) - Use
gdriveFolderto allow wallet backups to be seen and modified by the user
- Use
- Each option requests only the Drive OAuth scopes it needs (SDK version 7.4.0 and later):
.appDataFolderrequestshttps://www.googleapis.com/auth/drive.appdata.appDataFolderWithFallbackrequestshttps://www.googleapis.com/auth/drive.appdataandhttps://www.googleapis.com/auth/drive.file.gdriveFolder(folderName:)requestshttps://www.googleapis.com/auth/drive.file
- Switching a signed-in user to an option that needs a scope they have not granted triggers a one-time incremental consent prompt on the next backup or recovery.
- To clear the stored Google session and force a fresh sign-in (for example to let the user switch Google accounts), call
gDriveSignOut.