diff --git a/src/services/platforms/CapacitorPlatformService.ts b/src/services/platforms/CapacitorPlatformService.ts index 5c14d285..8df1985f 100644 --- a/src/services/platforms/CapacitorPlatformService.ts +++ b/src/services/platforms/CapacitorPlatformService.ts @@ -358,6 +358,9 @@ export class CapacitorPlatformService implements PlatformService { */ async writeFile(fileName: string, content: string): Promise { try { + // Check storage permissions before proceeding + await this.checkStoragePermissions(); + const logData = { targetFileName: fileName, contentLength: content.length, @@ -499,6 +502,9 @@ export class CapacitorPlatformService implements PlatformService { logger.log("[CapacitorPlatformService]", JSON.stringify(logData, null, 2)); try { + // Check storage permissions before proceeding + await this.checkStoragePermissions(); + const { uri } = await Filesystem.writeFile({ path: fileName, data: content,