Skip to content

@capgo/capacitor-share-target

Receive text, links, and files shared into your Capacitor app.

@capgo/capacitor-share-target receives content from other apps (Android SEND / SEND_MULTIPLE intents and an iOS Share Extension writing into an App Group). The plugin exposes a shareReceived listener with title, text, and files.

On iOS, shared payloads use notifyListeners(..., retainUntilConsumed: true) so a share that arrives before your WebView loads is still delivered to the first listener. That is share-specific cold start handling, not a general App Intent queue.

This plugin does not create Siri shortcuts or Shortcuts app actions. For those, use @capgo/capacitor-app-intents. It is unrelated to @capgo/capacitor-intent-launcher (Android activities and iOS Settings).

See Siri, Shortcuts, and widgets for a full comparison with expo-app-intents-style features.

PlatformSupportNotes
iOSYesShare extension setup in Xcode
AndroidYesIntent filters in manifest
WebNoUse PWA share target separately
  • addListener - Listen for shareReceived event.
  • removeAllListeners - Remove all listeners for this plugin.
  • getPluginVersion - Get the native Capacitor plugin version.
MethodDescription
addListenerListen for shareReceived event.
removeAllListenersRemove all listeners for this plugin.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-share-target.

Keep going from @capgo/capacitor-share-target

Section titled “Keep going from @capgo/capacitor-share-target”

If you are using @capgo/capacitor-share-target to plan native plugin work, connect it with Using @capgo/capacitor-share-target for the native capability in Using @capgo/capacitor-share-target, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.