Skip to content

[Feature] Receive what other apps share to the app (Android SEND intents, iOS share extension) #655

Open

Description

@houko

Context

core.Scope.Share (core/services.go:778) sends files and text to other apps, but an app cannot receive what other apps share to it. On Android the runtime manifest (internal/platform/android/runtime/AndroidManifest.xml:39) declares only MAIN/LAUNCHER for the activity, with no ACTION_SEND / ACTION_SEND_MULTIPLE intent filter, and nothing hands an incoming Intent's EXTRA_TEXT / EXTRA_STREAM to Go. On iOS there is no share extension target in what nsgo build makes.

Why it matters

A companion app (Kando's phone app) wants "Share → Kando" from Safari, the YouTube app or Bilibili to send a link to the user's computer. Without it the only path is copy, switch apps, paste.

Proposal

  • An app declares in nsgo.yaml the kinds it accepts (text/plain URLs, files by UTI / MIME type).
  • Android: nsgo build adds the SEND / SEND_MULTIPLE intent filters for those kinds; the activity forwards the intent's text and content URIs (copied into the app's cache) to Go.
  • iOS: nsgo build adds a share extension that hands the items to the app through the app group container and opens the app.
  • Go: a callback such as mobile.OnShared(cx, func(items []SharedItem)), delivered on the engine's goroutine, also for a share that arrives while the app is not running.

Acceptance

  • Sharing a URL from the system browser to the app on Android and iOS calls the callback with the URL.
  • Sharing a file delivers a readable path.
  • nsgotest can simulate an incoming share.

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. houko commented on Nov 20, 2026

    @houko
    CollaboratorAuthor

    I audited #655 against the current platform surface. NSGo can send shares but has no inbound shared-item API, Android SEND intent declarations/forwarding, or iOS share-extension target. A complete implementation requires project configuration, Android manifest/runtime changes, an iOS extension and app-group transport, a new core/mobile callback, cold-launch delivery, file staging, and nsgotest simulation. I left the feature open and did not submit a partial platform-only change.

  3. houko commented on Nov 22, 2026

    @houko
    CollaboratorAuthor

    Draft implementation: #1935 at 5753a3ef8e68b2581e7a206c018eedf15e58f413. Android receiving is already present from #1666; this change adds the iOS Go share extension, UTI configuration, App Group inbox, activation/notification delivery, durable callback acknowledgment, packaging/signing, and iOS nsgotest.ReceiveShare.

    The supported iOS behavior queues shares until the containing app is active or the user next opens it. Apple's public NSExtensionContext.open contract supports Today/iMessage extension points, not Share extensions: https://developer.apple.com/documentation/foundation/nsextensioncontext/open(_:completionhandler:). No responder-chain or private launch workaround is used. Automatic foreground/cold-launch remains an unsupported requirement.

    Validation passed:

    • Host check and dev client; macOS arm64/x64, iOS simulator, tvOS simulator, Android arm64, web, Windows arm64/x64, Linux arm64/x64 and HarmonyOS vet.
    • All 814 core tests; six inbox persistence/limits/path-confinement tests; core acknowledgment, headless receiving, layering, skills, block-bridge and changelog checks.
    • Ten focused tool tests, including actual vendored extension compilation and code-signature verification, independent widget/share Xcode targets, and provisioning bundle/group validation.
    • Five native iPhone XR tests without skips under a temporary task-only configuration without App Groups: real provider URL/plain-text/attachment imports, readable file bytes and MIME, direct URL/file copying, UTF-8 data with embedded NUL, private-file refusal, and simulated share delivery through the iOS engine host. The original YAML was restored and the task app uninstalled.

    The issue remains open and the PR is a draft. Physical App Group signing is blocked before installation because local Xcode has no configured account and its cached wildcard profile lacks App Groups. The dedicated simulator integration attempt timed out in CoreSimulator operations; no shared service was restarted. Safari/Files system share-sheet acceptance and actual extension-process startup are still pending. Native provider tests do not substitute for those gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions