# framework-res/receive_sharing_intent architecture

> Architecture diagram of the GitHub repository framework-res/receive_sharing_intent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/framework-res/receive_sharing_intent
- Repository: https://github.com/framework-res/receive_sharing_intent

## Overview

receive_sharing_intent is a Flutter plugin for handing shared text, URLs, images, videos, and files from other apps to a Flutter app. On Android, the plugin handles incoming intents, resolves shared URIs and emits media events. On iOS, a share extension processes attachments, optionally presents a compose UI, and saves results for the host app to retrieve. The platform plugins expose results through Flutter channels. Dart-side implementation was not sampled, so its connection to those channels is shown as unverified.

Main entry points: [`android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt`](https://github.com/framework-res/receive_sharing_intent/blob/master/android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt) (Intent handler), [`lib/src/receive_sharing_intent_mobile.dart`](https://github.com/framework-res/receive_sharing_intent/blob/master/lib/src/receive_sharing_intent_mobile.dart) (Media stream API), [`ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift`](https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift) (Host app plugin), [`ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift`](https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift) (Share extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android intake"]
  node_android_plugin["Intent handler"]
  node_uri_resolver["URI resolver<br/>[FileDirectory.kt]"]
end

subgraph group_ios["iOS sharing"]
  node_ios_extension["Share extension"]
  node_compose_ui["Compose UI"]
  node_app_group[("Shared app-group data")]
  node_ios_plugin["Host app plugin"]
end

subgraph group_flutter["Flutter API"]
  node_flutter_api["Flutter API"]
  node_media_model["Shared media model"]
  node_media_stream["Media stream API"]
end

node_sender(("Sharing app"))

node_sender -->|"shares intent"| node_android_plugin
node_android_plugin -->|"resolves URI"| node_uri_resolver
node_android_plugin -.->|"emits events"| node_media_stream
node_sender -->|"shares content"| node_ios_extension
node_ios_extension -->|"presents UI"| node_compose_ui
node_ios_extension -->|"writes shared data"| node_app_group
node_ios_plugin -->|"reads shared data"| node_app_group
node_ios_plugin -.->|"emits events"| node_media_stream
node_android_plugin -.->|"exposes channels"| node_flutter_api
node_ios_plugin -->|"exposes channels"| node_flutter_api
node_flutter_api -.->|"provides API"| node_media_stream
node_media_stream -.->|"uses model"| node_media_model

click node_android_plugin "https://github.com/framework-res/receive_sharing_intent/blob/master/android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt"
click node_uri_resolver "https://github.com/framework-res/receive_sharing_intent/blob/master/android/src/main/kotlin/com/kasem/receive_sharing_intent/FileDirectory.kt"
click node_ios_extension "https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift"
click node_compose_ui "https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIComposeView.swift"
click node_ios_plugin "https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift"
click node_flutter_api "https://github.com/framework-res/receive_sharing_intent/blob/master/lib/receive_sharing_intent.dart"
click node_media_model "https://github.com/framework-res/receive_sharing_intent/blob/master/lib/src/data/shared_media_file.dart"
click node_media_stream "https://github.com/framework-res/receive_sharing_intent/blob/master/lib/src/receive_sharing_intent_mobile.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android_plugin,node_uri_resolver toneBlue
class node_ios_extension,node_compose_ui,node_app_group,node_ios_plugin toneAmber
class node_flutter_api,node_media_model,node_media_stream toneMint
class node_sender toneIndigo
```

## Components

### Android intake

- [Intent handler](https://github.com/framework-res/receive_sharing_intent/blob/master/android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt): `android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt`
- [URI resolver](https://github.com/framework-res/receive_sharing_intent/blob/master/android/src/main/kotlin/com/kasem/receive_sharing_intent/FileDirectory.kt): `android/src/main/kotlin/com/kasem/receive_sharing_intent/FileDirectory.kt`

### iOS sharing

- [Share extension](https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift): `ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift`
- [Compose UI](https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIComposeView.swift): `ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIComposeView.swift`
- **Shared app-group data**
- [Host app plugin](https://github.com/framework-res/receive_sharing_intent/blob/master/ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift): `ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift`

### Flutter API

- [Flutter API](https://github.com/framework-res/receive_sharing_intent/blob/master/lib/receive_sharing_intent.dart): `lib/receive_sharing_intent.dart`
- [Shared media model](https://github.com/framework-res/receive_sharing_intent/blob/master/lib/src/data/shared_media_file.dart): `lib/src/data/shared_media_file.dart`
- [Media stream API](https://github.com/framework-res/receive_sharing_intent/blob/master/lib/src/receive_sharing_intent_mobile.dart): `lib/src/receive_sharing_intent_mobile.dart`

### Other components

- **Sharing app**

## Connections

- Sharing app → Intent handler: shares intent (evidence: `README.md`)
- Intent handler → URI resolver: resolves URI (evidence: `android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt`)
- Intent handler → Media stream API: emits events
- Sharing app → Share extension: shares content (evidence: `README.md`)
- Share extension → Compose UI: presents UI (evidence: `ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift`)
- Share extension → Shared app-group data: writes shared data (evidence: `ios/receive_sharing_intent/Sources/receive_sharing_intent/RSIShareViewController.swift`)
- Host app plugin → Shared app-group data: reads shared data (evidence: `ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift`)
- Host app plugin → Media stream API: emits events
- Intent handler → Flutter API: exposes channels
- Host app plugin → Flutter API: exposes channels (evidence: `ios/receive_sharing_intent/Sources/receive_sharing_intent/ReceiveSharingIntentPlugin.swift`)
- Flutter API → Media stream API: provides API
- Media stream API → Shared media model: uses model
