iOS Share Extension: pick the destination inside the share sheet

SwiftUI folder picker in the extension (WebDAV PROPFIND), account shared via
a Keychain group, upload on a background session that outlives the extension
and is finished by the app. The inbox + notification hand-off remains as the
fallback (no account / 'choose later'). Shared code moves to ios/Shared.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ayushya Amitabh
2026-10-06 19:36:04 -04:00
co-authored by Claude Sonnet 5.5
parent 525504bc47
commit afc9b90963
19 changed files with 841 additions and 154 deletions
+29
View File
@@ -75,6 +75,35 @@ enum NativeServices {
}
TransferManager.shared.reconnect()
registerShare(messenger: messenger)
registerShareAccount(messenger: messenger)
}
// MARK: - Account for the Share Extension
/// `share_account`: Dart tells native which account is active so the Share
/// Extension - a separate process with no Flutter engine - can list folders
/// and upload as it. Stored in the shared Keychain group.
private static func registerShareAccount(messenger: FlutterBinaryMessenger) {
FlutterMethodChannel(name: "dev.ayushya.noo/share_account", binaryMessenger: messenger)
.setMethodCallHandler { call, result in
switch call.method {
case "setAccount":
handle(call, result) { args in
try SharedAccountStore.save(
SharedAccount(
serverUrl: try string(args, "serverUrl"),
username: try string(args, "username"),
authHeader: try string(args, "authHeader"),
displayName: (args["displayName"] as? String) ?? ""
))
}
case "clearAccount":
SharedAccountStore.clear()
result(nil)
default:
result(FlutterMethodNotImplemented)
}
}
}
// MARK: - Share Extension inbox