From 7b0206b748dcd9f78b678e5f0d389d31ba7cf07f Mon Sep 17 00:00:00 2001 From: Aaron Madlon-Kay Date: Tue, 22 Apr 2025 21:44:55 +0900 Subject: [PATCH] Don't handle universal links on iOS This matches the behavior with app links on Android Fixes #38 --- .../SwiftFilePickerWritablePlugin.swift | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ios/Classes/SwiftFilePickerWritablePlugin.swift b/ios/Classes/SwiftFilePickerWritablePlugin.swift index 271d99f..798ff95 100644 --- a/ios/Classes/SwiftFilePickerWritablePlugin.swift +++ b/ios/Classes/SwiftFilePickerWritablePlugin.swift @@ -312,18 +312,19 @@ extension SwiftFilePickerWritablePlugin: FlutterApplicationLifeCycleDelegate { return _handle(url: url, persistable: false) } - public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]) -> Void) -> Bool { - // (handle universal links) - // Get URL components from the incoming user activity - guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, - let incomingURL = userActivity.webpageURL else { - logDebug("Unsupported user activity. \(userActivity)") - return false - } - logDebug("continue userActivity webpageURL: \(incomingURL)") - // TODO: Confirm that persistable should be true here - return _handle(url: incomingURL, persistable: true) - } + // This plugin should NOT handle this kind of link + // public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]) -> Void) -> Bool { + // // (handle universal links) + // // Get URL components from the incoming user activity + // guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, + // let incomingURL = userActivity.webpageURL else { + // logDebug("Unsupported user activity. \(userActivity)") + // return false + // } + // logDebug("continue userActivity webpageURL: \(incomingURL)") + // // TODO: Confirm that persistable should be true here + // return _handle(url: incomingURL, persistable: true) + // } private func _handle(url: URL, persistable: Bool) -> Bool { // if (!url.isFileURL) {