Repository navigation
feat(ios): receive shares through an App Group inbox - #1935
Conversation
5753a3e to
2cb5e34
Compare
d0575ac to
8ffa7cc
Compare
A Go share extension (NSGoShare.appex, apple.share_types) copies shared text and files into the App Group as atomic batches. The app drains them on activation and on a Darwin notification, off the main thread, and acknowledges each batch after mobile.OnShared returns. A batch that cannot be read is set aside and removed after a day instead of failing on every activation. Xcode device signing and IPA builds (sign.share_profile, -share-profile) sign the extension as its own target, and the signing project keeps the App Clip's targets intact. Refs nsgo-dev#655
533af06 to
b506d77
Compare
|
Reworked. Rebuilt on current main with only the share changes, dropping the stale-base doc and Xcode template reverts. The iOS surface now starts the inbox reader and wakes it on activation, so a real app drains the inbox. The signing template ranges over the extensions and keeps the App Clip's Frameworks phase and the project-level products directory; a new test checks that every referenced object ID is defined with widgets, a share extension and a Clip together. A batch that fails to read is set aside as |
Summary
Adds the missing iOS receiving path beside Android's existing implementation from #1666. Apps declare
apple.share_typesas UTIs and keep usingmobile.OnShared. A Go share extension imports provider objects/files into an atomic App Group inbox; the containing app copies files into its cache and delivers batches on activation or a Darwin notification while active.Batches remain durable until the app's callback returns, including while no handler is registered. The core acknowledges each batch once, and disk cleanup runs off the engine goroutine. URL and text providers use typed object loading; attachments retain file contents and MIME metadata, with private file URLs requiring a grant or a provider temporary copy.
The tool builds and signs
<id>.sharewithout handwritten C or Swift. Xcode device runs give widget and share extensions independent signing targets; IPA builds usesign.share_profileor-share-profile. The extension remains available in vendored tool dependencies. Public docs, the NSGo skill, roadmap, and changelog fragment are updated.Related to #655. Keep that issue open: this implements the supported inbox handoff, and does not claim full acceptance. Apple's NSExtensionContext.open documentation supports Today/iMessage extension points, not Share extensions; automatic foreground/cold-launch is therefore still an unsupported requirement.
Targets
core, thensgotool andnsgotest)Android's existing receiving path is unchanged. Shared-event consumers still accept the existing
[]SharedItempayload. App Clips, tvOS and watchOS do not receive a share extension.Screenshots
None; system share-sheet UI acceptance is pending.
Verification
go tool nsgo check, including the dev client.go tool nsgo check -target macos,ios_simulator,tvos_simulator,android,web,windows,linux,harmonyos -jobs 3: all requested targets passed, including both desktop architectures.ReceiveShare, layering, skill, block-bridge and changelog-fragment checks passed.codesign --verify --strict, Xcode project parsing with both extensions, profile bundle/group validation, and signing flag overrides.NSItemProvidercallbacks for URL/plain-text links and an attachment file, direct URL/file copying, UTF-8 data including embedded NUL, rejection of unscoped private file URLs, and iOSnsgotest.ReceiveShareengine delivery. The original YAML was restored and the task app uninstalled.Remaining acceptance
Checklist
changelog.d/ios-incoming-shares.md.