From 6f7be2e3b2fa9d6c4ee98df82578e4d1600ad953 Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 25 Jun 2026 18:37:04 +0800 Subject: [PATCH] chore(ios): add pendingShareExists cold-start share diagnostics (temporary) Extend ShareExtensionDiagnostics with pendingShareExists across SharedImageUtility, definitions, and the web stub, and log cold-start state (pending share + current route) in the iOS startup share check. --- ios/App/App/Info.plist | 50 ++++++++++++++-------------- ios/App/App/SharedImageUtility.swift | 18 ++++++++-- src/main.capacitor.ts | 14 ++++++++ src/plugins/SharedImagePlugin.web.ts | 2 ++ src/plugins/definitions.ts | 2 ++ 5 files changed, 58 insertions(+), 28 deletions(-) diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index c61ab2f2..3ef99a68 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -2,6 +2,13 @@ + BGTaskSchedulerPermittedIdentifiers + + org.timesafari.dailynotification.fetch + org.timesafari.dailynotification.notify + org.timesafari.dailynotification.content-fetch + org.timesafari.dailynotification.notification-delivery + CFBundleDevelopmentRegion en CFBundleDisplayName @@ -18,6 +25,17 @@ APPL CFBundleShortVersionString $(MARKETING_VERSION) + CFBundleURLTypes + + + CFBundleURLName + app.timesafari + CFBundleURLSchemes + + timesafari + + + CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS @@ -26,6 +44,13 @@ Time Safari allows you to take photos, and also scan QR codes from contacts. NSPhotoLibraryUsageDescription Time Safari allows you to upload photos. + NSUserNotificationAlertStyle + alert + UIBackgroundModes + + fetch + processing + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -47,30 +72,5 @@ UIViewControllerBasedStatusBarAppearance - CFBundleURLTypes - - - CFBundleURLName - app.timesafari - CFBundleURLSchemes - - timesafari - - - - UIBackgroundModes - - fetch - processing - - BGTaskSchedulerPermittedIdentifiers - - org.timesafari.dailynotification.fetch - org.timesafari.dailynotification.notify - org.timesafari.dailynotification.content-fetch - org.timesafari.dailynotification.notification-delivery - - NSUserNotificationAlertStyle - alert diff --git a/ios/App/App/SharedImageUtility.swift b/ios/App/App/SharedImageUtility.swift index 59f08339..38fd2029 100644 --- a/ios/App/App/SharedImageUtility.swift +++ b/ios/App/App/SharedImageUtility.swift @@ -108,7 +108,9 @@ public class SharedImageUtility { "shareExtensionLastStart": NSNull(), "sharedPhotoShareId": NSNull(), "sharedPhotoFilePath": NSNull(), - "fileExists": false + "fileExists": false, + // TEMPORARY SHARE TARGET DIAGNOSTICS + "pendingShareExists": false ] } @@ -123,13 +125,23 @@ public class SharedImageUtility { fileExists = false } - print("[ShareTarget] getShareExtensionDiagnostics shareExtensionLastStart=\(shareExtensionLastStart ?? "nil") sharedPhotoShareId=\(shareId ?? "nil") sharedPhotoFilePath=\(filePath ?? "nil") fileExists=\(fileExists)") + // TEMPORARY SHARE TARGET DIAGNOSTICS + let pendingShareExists = ( + shareExtensionLastStart != nil || + shareId != nil || + filePath != nil || + fileExists == true + ) + + print("[ShareTarget] getShareExtensionDiagnostics shareExtensionLastStart=\(shareExtensionLastStart ?? "nil") sharedPhotoShareId=\(shareId ?? "nil") sharedPhotoFilePath=\(filePath ?? "nil") fileExists=\(fileExists) pendingShareExists=\(pendingShareExists)") return [ "shareExtensionLastStart": shareExtensionLastStart ?? NSNull(), "sharedPhotoShareId": shareId ?? NSNull(), "sharedPhotoFilePath": filePath ?? NSNull(), - "fileExists": fileExists + "fileExists": fileExists, + // TEMPORARY SHARE TARGET DIAGNOSTICS + "pendingShareExists": pendingShareExists ] } diff --git a/src/main.capacitor.ts b/src/main.capacitor.ts index b533fc92..e89f0221 100644 --- a/src/main.capacitor.ts +++ b/src/main.capacitor.ts @@ -363,6 +363,20 @@ async function checkForSharedImageAndNavigate() { if (Capacitor.getPlatform() === "ios") { try { const diagnostics = await SharedImage.getShareExtensionDiagnostics(); + // TEMPORARY SHARE TARGET DIAGNOSTICS + console.info( + "[ShareTarget] Cold-start state", + JSON.stringify({ + pendingShareExists: diagnostics.pendingShareExists, + shareExtensionLastStart: diagnostics.shareExtensionLastStart, + sharedPhotoShareId: diagnostics.sharedPhotoShareId, + sharedPhotoFilePath: diagnostics.sharedPhotoFilePath, + fileExists: diagnostics.fileExists, + currentRoute: router.currentRoute.value.fullPath, + appReady: true, + timestamp: new Date().toISOString(), + }), + ); logger.info(`[ShareTarget] Diagnostics ${JSON.stringify(diagnostics)}`); } catch (diagnosticsError) { logger.info( diff --git a/src/plugins/SharedImagePlugin.web.ts b/src/plugins/SharedImagePlugin.web.ts index 71f021f6..70f8b35e 100644 --- a/src/plugins/SharedImagePlugin.web.ts +++ b/src/plugins/SharedImagePlugin.web.ts @@ -29,6 +29,8 @@ export class SharedImagePluginWeb sharedPhotoShareId: null, sharedPhotoFilePath: null, fileExists: false, + // TEMPORARY SHARE TARGET DIAGNOSTICS + pendingShareExists: false, }; } } diff --git a/src/plugins/definitions.ts b/src/plugins/definitions.ts index 1dd11255..5095b065 100644 --- a/src/plugins/definitions.ts +++ b/src/plugins/definitions.ts @@ -12,6 +12,8 @@ export interface ShareExtensionDiagnostics { sharedPhotoShareId: string | null; sharedPhotoFilePath: string | null; fileExists: boolean; + // TEMPORARY SHARE TARGET DIAGNOSTICS + pendingShareExists: boolean; } export interface SharedImagePlugin {