Skip to content

feat(ios): register and open document file types - #2034

Merged
houko merged 2 commits into
mainfrom
feat/ios-file-types-1385
Nov 22, 2026
Merged

houko merged 2 commits into
mainfrom
feat/ios-file-types-1385

Conversation

@houko

@houko houko commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

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 existing OnOpenFiles API.

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 2 and one combined check for macos_arm64,ios,ios_simulator,tvos,tvos_simulator.
  • Four native iOS 27 regression tests cover coordinated independent copies, invalid sources, separate file/link callbacks and delayed handler registration.
  • NSGO_SIMULATOR_E2E=1 go tool nsgo test -run '^TestIOSDocumentTypesEndToEnd$' ./cmd/nsgo -- -timeout=15m passes 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.
  • Host plist/queue tests, all module checks, the platform-duplicate comparison, changelog validation, actionlint and whitespace checks pass.

Refs #1385. File-provider and physical-device acceptance remain recorded in the roadmap; Android and HarmonyOS still lack document-type registration.

@github-actions github-actions Bot added size/L enhancement New feature or request documentation Improvements or additions to documentation iOS cli ci and removed enhancement New feature or request labels Nov 22, 2026
@houko houko mentioned this pull request Nov 22, 2026
1 task
@houko
houko force-pushed the feat/ios-file-types-1385 branch from bc461c6 to ff495cf Compare November 22, 2026 15:03
@houko

houko commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 22, 2026
@houko
houko merged commit a05b666 into main Nov 22, 2026
14 of 17 checks passed
@houko
houko deleted the feat/ios-file-types-1385 branch November 22, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci cli documentation Improvements or additions to documentation enhancement New feature or request iOS size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant