diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index 29639735..6a41bb17 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -9,13 +9,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // TEMPORARY SHARE TARGET DIAGNOSTICS - let launchURL = launchOptions?[.url] as? URL - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "didFinishLaunchingWithOptions urlSupplied=\(launchURL != nil) url=\(launchURL?.absoluteString ?? "nil") matchesTimesafari=\(AppDelegate.isTimesafariURL(launchURL)) launchOptionsHasURL=\(launchURL != nil) sharedImageActivationInvoked=false" - ) - // Set notification center delegate so notifications show in foreground and rollover is triggered UNUserNotificationCenter.current().delegate = self @@ -31,36 +24,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } func applicationWillResignActive(_ application: UIApplication) { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "applicationWillResignActive urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=false" - ) // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "applicationDidEnterBackground urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=false" - ) // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "applicationWillEnterForeground urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=false" - ) // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "applicationDidBecomeActive urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=true" - ) // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. // Re-set notification delegate when app becomes active (in case Capacitor resets it) @@ -102,12 +79,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD */ private func checkForSharedImageOnActivation() { // Check if shared photo is ready - // TEMPORARY SHARE TARGET DIAGNOSTICS let isReady = SharedImageUtility.isSharedPhotoReady() - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "checkForSharedImageOnActivation urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=true sharedPhotoReady=\(isReady)" - ) if isReady { // Clear the flag SharedImageUtility.clearSharedPhotoReadyFlag() @@ -119,18 +91,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } func applicationWillTerminate(_ application: UIApplication) { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "applicationWillTerminate urlSupplied=false url=nil matchesTimesafari=false launchOptionsHasURL=false sharedImageActivationInvoked=false" - ) // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { - // TEMPORARY SHARE TARGET DIAGNOSTICS - SharedImageUtility.appendAppLaunchTrace( - "application(open:) urlSupplied=true url=\(url.absoluteString) matchesTimesafari=\(AppDelegate.isTimesafariURL(url)) launchOptionsHasURL=false sharedImageActivationInvoked=false" - ) // Called when the app was launched with a url. Feel free to add additional processing here, // but if you want the App API to support tracking app url opens, make sure to keep this call // Note: Share Extension opens app with timesafari:// (empty path), which is handled by JavaScript @@ -138,13 +102,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD return ApplicationDelegateProxy.shared.application(app, open: url, options: options) } - // TEMPORARY SHARE TARGET DIAGNOSTICS - /// Returns true when the supplied URL uses the timesafari:// scheme. - /// Diagnostics-only helper; does not affect URL handling. - private static func isTimesafariURL(_ url: URL?) -> Bool { - return url?.scheme?.lowercased() == "timesafari" - } - func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { // Called when the app was launched with an activity, including Universal Links. // Feel free to add additional processing here, but if you want the App API to support diff --git a/ios/App/App/SharedImagePlugin.swift b/ios/App/App/SharedImagePlugin.swift index 627ac830..06abe82c 100644 --- a/ios/App/App/SharedImagePlugin.swift +++ b/ios/App/App/SharedImagePlugin.swift @@ -25,15 +25,7 @@ public class SharedImagePlugin: CAPPlugin, CAPBridgedPlugin { return [ CAPPluginMethod(#selector(getSharedImage(_:)), returnType: .promise), CAPPluginMethod(#selector(hasSharedImage(_:)), returnType: .promise), - CAPPluginMethod(#selector(getShareExtensionDiagnostics(_:)), returnType: .promise), - // TEMPORARY SHARE TARGET DIAGNOSTICS - CAPPluginMethod(#selector(getShareExtensionTrace(_:)), returnType: .promise), - // TEMPORARY SHARE TARGET DIAGNOSTICS - CAPPluginMethod(#selector(clearShareExtensionTrace(_:)), returnType: .promise), - // TEMPORARY SHARE TARGET DIAGNOSTICS - CAPPluginMethod(#selector(getAppLaunchTrace(_:)), returnType: .promise), - // TEMPORARY SHARE TARGET DIAGNOSTICS - CAPPluginMethod(#selector(clearAppLaunchTrace(_:)), returnType: .promise) + CAPPluginMethod(#selector(getShareExtensionDiagnostics(_:)), returnType: .promise) ] } @@ -78,43 +70,5 @@ public class SharedImagePlugin: CAPPlugin, CAPBridgedPlugin { @objc public func getShareExtensionDiagnostics(_ call: CAPPluginCall) { call.resolve(SharedImageUtility.getShareExtensionDiagnostics()) } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Return the raw Share Extension execution trace log from the App Group container - */ - @objc public func getShareExtensionTrace(_ call: CAPPluginCall) { - call.resolve([ - "trace": SharedImageUtility.getShareExtensionTrace() - ]) - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the Share Extension execution trace log if present - */ - @objc public func clearShareExtensionTrace(_ call: CAPPluginCall) { - SharedImageUtility.clearShareExtensionTrace() - call.resolve() - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Return the raw app launch lifecycle trace log from the App Group container - */ - @objc public func getAppLaunchTrace(_ call: CAPPluginCall) { - call.resolve([ - "trace": SharedImageUtility.getAppLaunchTrace() - ]) - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the app launch lifecycle trace log if present - */ - @objc public func clearAppLaunchTrace(_ call: CAPPluginCall) { - SharedImageUtility.clearAppLaunchTrace() - call.resolve() - } } diff --git a/ios/App/App/SharedImageUtility.swift b/ios/App/App/SharedImageUtility.swift index fb8e022e..38fd2029 100644 --- a/ios/App/App/SharedImageUtility.swift +++ b/ios/App/App/SharedImageUtility.swift @@ -16,10 +16,6 @@ public class SharedImageUtility { private static let sharedPhotoShareIdKey = "sharedPhotoShareId" private static let shareExtensionLastStartKey = "shareExtensionLastStart" private static let sharedPhotoReadyKey = "sharedPhotoReady" - // TEMPORARY SHARE TARGET DIAGNOSTICS - private static let shareExtensionTraceFileName = "share-extension-trace.log" - // TEMPORARY SHARE TARGET DIAGNOSTICS - private static let appLaunchTraceFileName = "app-launch-trace.log" /// Get the App Group container URL for accessing shared files private static var appGroupContainerURL: URL? { @@ -149,81 +145,6 @@ public class SharedImageUtility { ] } - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Read the Share Extension trace file from the App Group container. - * Read-only: does not modify or delete the trace file. - * - * @returns the full trace contents, or an empty string if no trace exists - */ - static func getShareExtensionTrace() -> String { - guard let containerURL = appGroupContainerURL else { - return "" - } - let fileURL = containerURL.appendingPathComponent(shareExtensionTraceFileName) - return (try? String(contentsOf: fileURL, encoding: .utf8)) ?? "" - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the Share Extension trace file from the App Group container if present. - */ - static func clearShareExtensionTrace() { - guard let containerURL = appGroupContainerURL else { - return - } - let fileURL = containerURL.appendingPathComponent(shareExtensionTraceFileName) - try? FileManager.default.removeItem(at: fileURL) - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Append a single timestamped line to the app launch trace file in the - * App Group container. Each line is prefixed with an ISO8601 timestamp. - * Append-only; logging failures are intentionally swallowed (diagnostics only). - */ - static func appendAppLaunchTrace(_ message: String) { - guard let containerURL = appGroupContainerURL else { return } - let fileURL = containerURL.appendingPathComponent(appLaunchTraceFileName) - let timestamp = ISO8601DateFormatter().string(from: Date()) - let line = "\(timestamp) \(message)\n" - guard let data = line.data(using: .utf8) else { return } - if let handle = try? FileHandle(forWritingTo: fileURL) { - defer { try? handle.close() } - _ = try? handle.seekToEnd() - try? handle.write(contentsOf: data) - } else { - try? data.write(to: fileURL, options: .atomic) - } - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Read the app launch trace file from the App Group container. - * Read-only: does not modify or delete the trace file. - * - * @returns the full trace contents, or an empty string if no trace exists - */ - static func getAppLaunchTrace() -> String { - guard let containerURL = appGroupContainerURL else { - return "" - } - let fileURL = containerURL.appendingPathComponent(appLaunchTraceFileName) - return (try? String(contentsOf: fileURL, encoding: .utf8)) ?? "" - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the app launch trace file from the App Group container if present. - */ - static func clearAppLaunchTrace() { - guard let containerURL = appGroupContainerURL else { - return - } - let fileURL = containerURL.appendingPathComponent(appLaunchTraceFileName) - try? FileManager.default.removeItem(at: fileURL) - } - /** * Check if shared photo ready flag is set * This flag is set by the Share Extension when image is ready diff --git a/ios/App/TimeSafariShareExtension/ShareViewController.swift b/ios/App/TimeSafariShareExtension/ShareViewController.swift index 7e599a5d..a8cdb460 100644 --- a/ios/App/TimeSafariShareExtension/ShareViewController.swift +++ b/ios/App/TimeSafariShareExtension/ShareViewController.swift @@ -17,36 +17,12 @@ class ShareViewController: UIViewController { private let shareExtensionLastStartKey = "shareExtensionLastStart" private let sharedImageFileName = "shared-image" - // TEMPORARY SHARE TARGET DIAGNOSTICS - private let shareExtensionTraceFileName = "share-extension-trace.log" - /// Get the App Group container URL for storing shared files private var appGroupContainerURL: URL? { return FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupIdentifier) } - // TEMPORARY SHARE TARGET DIAGNOSTICS - /// Append a single timestamped line to the Share Extension trace file in the - /// App Group container. Each line is prefixed with an ISO8601 timestamp. - /// Logging failures are intentionally ignored (diagnostics only). - private func appendTrace(_ message: String) { - guard let containerURL = appGroupContainerURL else { return } - let fileURL = containerURL.appendingPathComponent(shareExtensionTraceFileName) - let timestamp = ISO8601DateFormatter().string(from: Date()) - let line = "\(timestamp) \(message)\n" - guard let data = line.data(using: .utf8) else { return } - if let handle = try? FileHandle(forWritingTo: fileURL) { - defer { try? handle.close() } - _ = try? handle.seekToEnd() - try? handle.write(contentsOf: data) - } else { - try? data.write(to: fileURL, options: .atomic) - } - } - override func viewDidLoad() { - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("viewDidLoad START") if let userDefaults = UserDefaults(suiteName: appGroupIdentifier) { let timestamp = ISO8601DateFormatter().string(from: Date()) userDefaults.set(timestamp, forKey: shareExtensionLastStartKey) @@ -63,29 +39,19 @@ class ShareViewController: UIViewController { // Process image immediately without showing UI processAndOpenApp() print("[ShareTarget] viewDidLoad completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("viewDidLoad END") } private func processAndOpenApp() { print("[ShareTarget] processAndOpenApp started") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("processAndOpenApp START") // extensionContext is automatically available on UIViewController when used as extension principal class guard let context = extensionContext, let inputItems = context.inputItems as? [NSExtensionItem] else { print("[ShareTarget] processAndOpenApp failed: missing extensionContext or inputItems") print("[ShareTarget] completeRequest starting") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("completeRequest START") extensionContext?.completeRequest(returningItems: [], completionHandler: nil) print("[ShareTarget] completeRequest completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("completeRequest END") print("[ShareTarget] processAndOpenApp completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("processAndOpenApp END") return } @@ -98,8 +64,6 @@ class ShareViewController: UIViewController { guard let self = self, let context = self.extensionContext else { print("[ShareTarget] processAndOpenApp failed: self or extensionContext unavailable in completion") print("[ShareTarget] processAndOpenApp completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self?.appendTrace("processAndOpenApp END") return } @@ -114,35 +78,23 @@ class ShareViewController: UIViewController { // Complete immediately - no UI shown print("[ShareTarget] completeRequest starting") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("completeRequest START") context.completeRequest(returningItems: [], completionHandler: nil) print("[ShareTarget] completeRequest completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("completeRequest END") print("[ShareTarget] processAndOpenApp completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("processAndOpenApp END") } } private func setSharedPhotoReadyFlag() { print("[ShareTarget] setSharedPhotoReadyFlag started") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("setSharedPhotoReadyFlag START") guard let userDefaults = UserDefaults(suiteName: appGroupIdentifier) else { print("[ShareTarget] setSharedPhotoReadyFlag failed: UserDefaults unavailable for app group") print("[ShareTarget] setSharedPhotoReadyFlag completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("setSharedPhotoReadyFlag FAILURE") return } userDefaults.set(true, forKey: "sharedPhotoReady") userDefaults.synchronize() print("[ShareTarget] setSharedPhotoReadyFlag success") print("[ShareTarget] setSharedPhotoReadyFlag completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("setSharedPhotoReadyFlag SUCCESS") } private func processSharedImage(from items: [NSExtensionItem], completion: @escaping (Bool) -> Void) { @@ -150,8 +102,6 @@ class ShareViewController: UIViewController { count + (item.attachments?.count ?? 0) } print("[ShareTarget] processSharedImage started attachmentCount=\(attachmentCount)") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("processSharedImage START") // Find the first image attachment for item in items { @@ -170,8 +120,6 @@ class ShareViewController: UIViewController { let shareId = UUID().uuidString print("[ShareTarget] processSharedImage found image attachment shareId=\(shareId) UTType=\(UTType.image.identifier)") print("[ShareTarget] share received shareId=\(shareId)") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("image attachment found shareId=\(shareId)") // Try to load raw data first to preserve original format // This preserves the original image format without conversion @@ -186,8 +134,6 @@ class ShareViewController: UIViewController { if let error = error { print("[ShareTarget] processSharedImage failed: loadItem error shareId=\(shareId) error=\(error.localizedDescription)") print("[ShareTarget] processSharedImage completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("processSharedImage END success=false") completion(false) return } @@ -231,27 +177,19 @@ class ShareViewController: UIViewController { guard let finalImageData = imageData else { print("[ShareTarget] processSharedImage failed: no image data shareId=\(shareId)") print("[ShareTarget] processSharedImage completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("processSharedImage END success=false") completion(false) return } print("[ShareTarget] image loaded bytes=\(finalImageData.count) filename=\(fileName) shareId=\(shareId)") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("image loaded shareId=\(shareId) bytes=\(finalImageData.count)") // Store image as file in App Group container if self.storeImageData(finalImageData, fileName: fileName, shareId: shareId) { print("[ShareTarget] processSharedImage completed shareId=\(shareId) success=true") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("processSharedImage END success=true") completion(true) } else { print("[ShareTarget] processSharedImage failed: storeImageData returned false shareId=\(shareId)") print("[ShareTarget] processSharedImage completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - self.appendTrace("processSharedImage END success=false") completion(false) } } @@ -262,8 +200,6 @@ class ShareViewController: UIViewController { // No image found print("[ShareTarget] processSharedImage failed: no image attachment found attachmentCount=\(attachmentCount)") print("[ShareTarget] processSharedImage completed success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("processSharedImage END success=false") completion(false) } @@ -291,14 +227,10 @@ class ShareViewController: UIViewController { /// Returns true if successful, false otherwise private func storeImageData(_ imageData: Data, fileName: String, shareId: String) -> Bool { print("[ShareTarget] storeImageData started shareId=\(shareId) bytes=\(imageData.count) filename=\(fileName)") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("storeImageData START shareId=\(shareId)") guard let containerURL = appGroupContainerURL else { print("[ShareTarget] storeImageData failed: app group container unavailable shareId=\(shareId)") print("[ShareTarget] storeImageData completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("storeImageData FAILURE shareId=\(shareId)") return false } @@ -321,8 +253,6 @@ class ShareViewController: UIViewController { } catch { print("[ShareTarget] storeImageData failed: file write error shareId=\(shareId) error=\(error.localizedDescription)") print("[ShareTarget] storeImageData completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("storeImageData FAILURE shareId=\(shareId)") return false } print("[ShareTarget] file stored shareId=\(shareId) originalFilename=\(originalFileName) storedFilename=\(storedFileName)") @@ -331,8 +261,6 @@ class ShareViewController: UIViewController { guard let userDefaults = UserDefaults(suiteName: appGroupIdentifier) else { print("[ShareTarget] storeImageData failed: UserDefaults unavailable shareId=\(shareId)") print("[ShareTarget] storeImageData completed shareId=\(shareId) success=false") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("storeImageData FAILURE shareId=\(shareId)") return false } @@ -348,22 +276,16 @@ class ShareViewController: UIViewController { print("[ShareTarget] metadata stored shareId=\(shareId) originalFilename=\(originalFileName) storedFilename=\(storedFileName)") print("[ShareTarget] storeImageData success shareId=\(shareId)") print("[ShareTarget] storeImageData completed shareId=\(shareId) success=true") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("storeImageData SUCCESS shareId=\(shareId)") return true } private func openMainApp() { print("[ShareTarget] openMainApp starting") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("openMainApp START") // Open the main app with minimal URL - app will detect shared data on activation guard let url = URL(string: "timesafari://") else { print("[ShareTarget] openMainApp failed: could not create timesafari:// URL") print("[ShareTarget] openMainApp completed") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("openMainApp FAILURE") return } @@ -372,8 +294,6 @@ class ShareViewController: UIViewController { if let application = responder as? UIApplication { application.open(url, options: [:], completionHandler: nil) print("[ShareTarget] openMainApp completed via UIApplication") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("openMainApp SUCCESS") return } responder = responder?.next @@ -382,8 +302,6 @@ class ShareViewController: UIViewController { // Fallback: use extension context extensionContext?.open(url, completionHandler: nil) print("[ShareTarget] openMainApp completed via extensionContext fallback") - // TEMPORARY SHARE TARGET DIAGNOSTICS - appendTrace("openMainApp SUCCESS") } } diff --git a/src/main.capacitor.ts b/src/main.capacitor.ts index 16be9559..581a401e 100644 --- a/src/main.capacitor.ts +++ b/src/main.capacitor.ts @@ -388,44 +388,6 @@ async function checkForSharedImageAndNavigate() { })}`, ); } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - const traceResult = await SharedImage.getShareExtensionTrace(); - - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info("[ShareTarget] TRACE FULL START"); - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info(traceResult.trace); - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info("[ShareTarget] TRACE FULL END"); - - // TEMPORARY SHARE TARGET DIAGNOSTICS - if (Capacitor.getPlatform() === "ios") { - alert(traceResult.trace); - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info("[ShareTarget] Extension Trace\n" + traceResult.trace); - - // TEMPORARY SHARE TARGET DIAGNOSTICS - const traceLength = traceResult.trace.length; - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info(`[ShareTarget] TRACE LENGTH=${traceLength}`); - // TEMPORARY SHARE TARGET DIAGNOSTICS - if (traceLength > 0) { - console.info( - "[ShareTarget] TRACE FIRST 500\n" + traceResult.trace.slice(0, 500), - ); - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - const launchTraceResult = await SharedImage.getAppLaunchTrace(); - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info("[ShareTarget] APP LAUNCH TRACE START"); - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info(launchTraceResult.trace); - // TEMPORARY SHARE TARGET DIAGNOSTICS - console.info("[ShareTarget] APP LAUNCH TRACE END"); } logger.debug("[Main] 🔍 Checking for shared image on app activation"); diff --git a/src/plugins/SharedImagePlugin.web.ts b/src/plugins/SharedImagePlugin.web.ts index 6671503e..70f8b35e 100644 --- a/src/plugins/SharedImagePlugin.web.ts +++ b/src/plugins/SharedImagePlugin.web.ts @@ -8,10 +8,6 @@ import type { SharedImagePlugin, SharedImageResult, ShareExtensionDiagnostics, - // TEMPORARY SHARE TARGET DIAGNOSTICS - ShareExtensionTrace, - // TEMPORARY SHARE TARGET DIAGNOSTICS - AppLaunchTrace, } from "./definitions"; export class SharedImagePluginWeb @@ -37,24 +33,4 @@ export class SharedImagePluginWeb pendingShareExists: false, }; } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - async getShareExtensionTrace(): Promise { - return { trace: "" }; - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - async clearShareExtensionTrace(): Promise { - // Web platform doesn't support native sharing - no-op - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - async getAppLaunchTrace(): Promise { - return { trace: "" }; - } - - // TEMPORARY SHARE TARGET DIAGNOSTICS - async clearAppLaunchTrace(): Promise { - // Web platform doesn't support native launch tracing - no-op - } } diff --git a/src/plugins/definitions.ts b/src/plugins/definitions.ts index c0b2c29b..5095b065 100644 --- a/src/plugins/definitions.ts +++ b/src/plugins/definitions.ts @@ -16,16 +16,6 @@ export interface ShareExtensionDiagnostics { pendingShareExists: boolean; } -// TEMPORARY SHARE TARGET DIAGNOSTICS -export interface ShareExtensionTrace { - trace: string; -} - -// TEMPORARY SHARE TARGET DIAGNOSTICS -export interface AppLaunchTrace { - trace: string; -} - export interface SharedImagePlugin { /** * Get shared image data from native layer @@ -44,28 +34,4 @@ export interface SharedImagePlugin { * Diagnostic snapshot of Share Extension startup and pending share state (iOS) */ getShareExtensionDiagnostics(): Promise; - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Read the raw Share Extension execution trace log (iOS) - */ - getShareExtensionTrace(): Promise; - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the Share Extension execution trace log if present (iOS) - */ - clearShareExtensionTrace(): Promise; - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Read the raw app launch lifecycle trace log (iOS) - */ - getAppLaunchTrace(): Promise; - - // TEMPORARY SHARE TARGET DIAGNOSTICS - /** - * Delete the app launch lifecycle trace log if present (iOS) - */ - clearAppLaunchTrace(): Promise; } diff --git a/src/router/index.ts b/src/router/index.ts index 8bdbdcd6..ab6502d1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -290,12 +290,6 @@ const routes: Array = [ name: "test", component: () => import("../views/TestView.vue"), }, - // TEMPORARY SHARE TARGET DIAGNOSTICS - { - path: "/share-target-debug", - name: "share-target-debug", - component: () => import("../views/ShareTargetDebugView.vue"), - }, { path: "/user-profile/:id?", name: "user-profile", diff --git a/src/views/ShareTargetDebugView.vue b/src/views/ShareTargetDebugView.vue deleted file mode 100644 index 9a09c8ce..00000000 --- a/src/views/ShareTargetDebugView.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - - - diff --git a/src/views/TestView.vue b/src/views/TestView.vue index b420cef6..ecea8c78 100644 --- a/src/views/TestView.vue +++ b/src/views/TestView.vue @@ -112,21 +112,6 @@ - -
-

Share Target Diagnostics

-

- Temporary debug panel for the iOS Share Target investigation (dump/clear - native traces). -

- - Open Share Target Debug Panel - -
-

URL Flow Testing