// Example 1: Using App Data Folder (recommended)
do {
try portal.setGDriveConfiguration(
clientId: "your-google-client-id",
backupOption: .appDataFolder
)
} catch {
print("Error configuring Google Drive with App Data Folder: \(error)")
}
// Example 2: Using visible folder with custom name
do {
try portal.setGDriveConfiguration(
clientId: "your-google-client-id",
backupOption: .gdriveFolder(folderName: "MyAppBackups")
)
} catch {
print("Error configuring Google Drive with custom folder: \(error)")
}
// Example 3: Using App Data Folder for backup and recover with fallback to GDrive Folder if recover fails
do {
try portal.setGDriveConfiguration(
clientId: "your-google-client-id",
backupOption: .appDataFolderWithFallback
)
} catch {
print("Error configuring Google Drive with fallback: \(error)")
}