Repository navigation
feat(ios): register and open document file types - #2034
Conversation
bc461c6 to
ff495cf
Compare
|
Reviewed. Full iOS packages now register file_types without the macOS icon keys (tvOS and App Clips are left out), and scene connection and openURLContexts file URLs are imported serially off the main thread through NSFileCoordinator, inside their security scope, into exclusive temp copies before reaching OnOpenFiles, with launch files held for the first handler. Links stay separate. I rebased onto main (test.yml and roadmap conflicts; the new simulator tests were added to main's expanded list) and added one commit declaring LSSupportsOpeningDocumentsInPlace false, which matches the copy model; App Store Connect warns when an app declares document types without it. Vetted iOS (simulator SDK with nsgotest), desktop and cmd/nsgo, and ran the plist tests including plutil lint. |
iOS bundles omitted
file_types, and scene URL callbacks discarded file URLs. Register document types in full iOS packages and deliver cold and warm document opens through the existingOnOpenFilesAPI.Document imports run serially off the UI thread through
NSFileCoordinator. Each import keeps its incoming filename, copies into app-owned temporary storage and ends its security scope before delivery. This follows the document picker's copy model because the path-only callback has no scope-release contract. Custom links keep their separate handler. App Clips and tvOS omit declarations, while macOS document icons remain unchanged.Adds English/Chinese public documentation, the app-author skill, a changelog fragment, native regression tests and simulator CI coverage.
Verification:
go tool nsgo check -jobs 2and one combined check formacos_arm64,ios,ios_simulator,tvos,tvos_simulator.NSGO_SIMULATOR_E2E=1 go tool nsgo test -run '^TestIOSDocumentTypesEndToEnd$' ./cmd/nsgo -- -timeout=15mpasses against a packaged receiver: a cold file launch, a warm file in the same PID, exact Unicode names/body/SHA256, copies surviving sender uninstall, and a separate custom link. The sender presents Open In and invokes UIKit's test-only default-recipient action; UIKit/Launch Services create the receiver's real URL contexts. This does not claim a picker tap.actionlintand whitespace checks pass.Refs #1385. File-provider and physical-device acceptance remain recorded in the roadmap; Android and HarmonyOS still lack document-type registration.