Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/NPM_PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The npm package connection is restricted to:

```text
Provider: GitHub Actions
Repository: ngocdevv/expo-share-content
Repository: ngocdevv/react-native-share-content
Workflow: publish-npm.yml
Allowed action: npm publish
```
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@
### 🐛 Bug fixes

### 💡 Others

## 0.2.0

### 🛠 Breaking changes

- Rename the npm package from `expo-share-content` to `react-native-share-content`.
- Update the Expo config plugin specifier and all installation/import examples to the new package name.

### 💡 Others

- Rename the GitHub repository and GitHub Pages project path to `react-native-share-content`.
- Keep the JavaScript API, native module names, Android package namespace, and legacy generated-code marker unchanged for upgrade compatibility.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 expo-share-content contributors
Copyright (c) 2026 react-native-share-content contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# expo-share-content
# react-native-share-content

Receive text, URLs, images, videos, audio, and files shared **into** an Expo app.

`expo-share-content` is an Expo Module alternative to bridge-based packages such as `react-native-share-menu`. It supports cold starts, warm starts, multiple attachments, a durable pending queue, typed events, and Expo config plugins for Android share intents and an iOS Share Extension.
`react-native-share-content` is an Expo Module alternative to bridge-based packages such as `react-native-share-menu`. It supports cold starts, warm starts, multiple attachments, a durable pending queue, typed events, and Expo config plugins for Android share intents and an iOS Share Extension.

> [!NOTE]
> This package was previously published as `expo-share-content`. Existing users should remove the old dependency, install `react-native-share-content`, update imports and the Expo config plugin entry, then run `npx expo prebuild --clean`. The JavaScript API and native module identifiers are unchanged.

## Demo

| Android | iOS |
| :---: | :---: |
| ![Receive shared content on Android](https://raw.githubusercontent.com/ngocdevv/expo-share-content/main/docs/static/img/demo-android.gif) | ![Receive shared content on iOS](https://raw.githubusercontent.com/ngocdevv/expo-share-content/main/docs/static/img/demo-ios.gif) |
| ![Receive shared content on Android](https://raw.githubusercontent.com/ngocdevv/react-native-share-content/main/docs/static/img/demo-android.gif) | ![Receive shared content on iOS](https://raw.githubusercontent.com/ngocdevv/react-native-share-content/main/docs/static/img/demo-ios.gif) |

> [!IMPORTANT]
> This package contains native code and does **not** work in Expo Go. Use a development build or production build after running prebuild.
Expand All @@ -33,7 +36,7 @@ Delivery is **at least once**. A cold-start query and a live event can refer to
## Installation

```sh
npx expo install expo-share-content
npx expo install react-native-share-content
```

Add platform identifiers and the config plugin:
Expand All @@ -50,7 +53,7 @@ Add platform identifiers and the config plugin:
},
"plugins": [
[
"expo-share-content",
"react-native-share-content",
{
"iosShareExtensionName": "ShareExtension"
}
Expand Down Expand Up @@ -93,7 +96,7 @@ Register the listener early, then inspect pending shares. Keep processing idempo
```tsx
import ExpoShareContent, {
type SharePayload,
} from 'expo-share-content';
} from 'react-native-share-content';
import { useEffect } from 'react';

export function ShareReceiver() {
Expand Down Expand Up @@ -258,7 +261,7 @@ Example with narrower Android filters and explicit Apple identifiers:

```json
[
"expo-share-content",
"react-native-share-content",
{
"androidIntentFilters": ["text/plain", "image/*"],
"androidMultiIntentFilters": ["image/*"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal class ShareContentIntentParser(
addItem(items, fileItem(stream, intent.type, shareId, intent))
}
} catch (error: Throwable) {
File(context.noBackupFilesDir, "expo-share-content/$shareId").deleteRecursively()
File(context.noBackupFilesDir, "react-native-share-content/$shareId").deleteRecursively()
throw error
}

Expand Down Expand Up @@ -234,7 +234,7 @@ internal class ShareContentIntentParser(
throw IllegalArgumentException("Shared files exceed the $maxTotalSize-byte aggregate limit")
}

val directory = File(context.noBackupFilesDir, "expo-share-content/$shareId")
val directory = File(context.noBackupFilesDir, "react-native-share-content/$shareId")
check(directory.mkdirs() || directory.isDirectory) { "Cannot create share cache directory" }

val safeName = File(proposedName).name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ internal object ShareContentQueue {
require(id.isNotBlank() && id != "." && id != ".." && File(id).name == id) {
"Invalid share receipt ID: $id"
}
id to File(context.noBackupFilesDir, "expo-share-content/$id")
id to File(context.noBackupFilesDir, "react-native-share-content/$id")
}
for ((id, directory) in directories) {
check(!directory.exists() || directory.deleteRecursively()) {
Expand All @@ -169,7 +169,7 @@ internal object ShareContentQueue {
}

private fun storageRoot(context: Context): File =
File(context.noBackupFilesDir, "expo-share-content")
File(context.noBackupFilesDir, "react-native-share-content")

private fun atomicQueueFile(context: Context): AtomicFile {
val root = storageRoot(context)
Expand Down
4 changes: 2 additions & 2 deletions docs/PRD.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Product requirements: expo-share-content
# Product requirements: react-native-share-content

## 1. Problem

Expo applications need a reliable way to receive content from the native share sheet. Existing React Native packages commonly depend on the legacy bridge, manual AndroidManifest edits, and manually maintained iOS Share Extension targets. Event-only APIs also lose data when JavaScript is not ready during a cold start.

`expo-share-content` provides the same core capability using Expo Modules and an Expo config plugin.
`react-native-share-content` provides the same core capability using Expo Modules and an Expo config plugin.

## 2. Goals

Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# expo-share-content documentation
# react-native-share-content documentation

This directory contains the Docusaurus website for `expo-share-content`.
This directory contains the Docusaurus website for `react-native-share-content`.

## Local development

Expand All @@ -10,7 +10,7 @@ npm install
npm start
```

The development server opens at `http://localhost:3000/expo-share-content/`.
The development server opens at `http://localhost:3000/react-native-share-content/`.

## Production build

Expand All @@ -21,7 +21,7 @@ npm run serve
```

The static output is written to `docs/build/` and is configured for GitHub Pages at
`https://ngocdevv.github.io/expo-share-content/`.
`https://ngocdevv.github.io/react-native-share-content/`.

## Deployment

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All share methods are available on the default export and as named exports. `ded
import ExpoShareContent, {
getPendingSharesAsync,
type SharePayload,
} from 'expo-share-content';
} from 'react-native-share-content';
```

## `getPendingSharesAsync`
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Pass options as the second item in the Expo config-plugin tuple.
},
"plugins": [
[
"expo-share-content",
"react-native-share-content",
{
"androidIntentFilters": ["text/plain", "image/*"],
"androidMultiIntentFilters": ["image/*"],
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/fundamentals/delivery-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ await ExpoShareContent.releaseSharedFilesAsync([payload.id]);
Use the named helper when combining event and query results:

```ts
import {dedupeShares} from 'expo-share-content';
import {dedupeShares} from 'react-native-share-content';

const unique = dedupeShares([...pending, ...recentEvents]);
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/fundamentals/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Understand the native intake, durable queue, and JavaScript process

# How it works

Native share flows begin outside your React Native runtime. `expo-share-content` separates intake, persistence, and application processing so JavaScript startup timing does not decide whether content is delivered.
Native share flows begin outside your React Native runtime. `react-native-share-content` separates intake, persistence, and application processing so JavaScript startup timing does not decide whether content is delivered.

## The three layers

Expand Down
10 changes: 5 additions & 5 deletions docs/docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
sidebar_position: 1
title: Getting started
description: Install expo-share-content, configure the Expo plugin, and receive your first shared payload.
description: Install react-native-share-content, configure the Expo plugin, and receive your first shared payload.
---

# Getting started

Receive text, URLs, images, video, audio, and files shared **into** an Expo app.

:::info Native module required
`expo-share-content` does not work in Expo Go. Use a development build or a production build after running Expo prebuild.
`react-native-share-content` does not work in Expo Go. Use a development build or a production build after running Expo prebuild.
:::

## Requirements
Expand All @@ -24,7 +24,7 @@ Receive text, URLs, images, video, audio, and files shared **into** an Expo app.
## Install

```bash
npx expo install expo-share-content
npx expo install react-native-share-content
```

## Add the config plugin
Expand All @@ -43,7 +43,7 @@ Add platform identifiers and the package to your Expo configuration:
},
"plugins": [
[
"expo-share-content",
"react-native-share-content",
{
"iosShareExtensionName": "ShareExtension",
"iosOpenHostAppAfterShare": false
Expand All @@ -67,7 +67,7 @@ Register listeners early, then query pending payloads. Keep processing idempoten
```tsx title="ShareReceiver.tsx"
import ExpoShareContent, {
type SharePayload,
} from 'expo-share-content';
} from 'react-native-share-content';
import { useEffect } from 'react';

export function ShareReceiver() {
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/platforms/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Set it to `true` only if you want a best-effort foreground attempt:
"scheme": "myapp",
"plugins": [
[
"expo-share-content",
"react-native-share-content",
{
"iosOpenHostAppAfterShare": true
}
Expand Down
30 changes: 15 additions & 15 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import type {Options, ThemeConfig} from '@docusaurus/preset-classic';
import {themes as prismThemes} from 'prism-react-renderer';

const config: Config = {
title: 'Expo Share Content',
title: 'React Native Share Content',
tagline: 'Receive shared content reliably in Expo apps',
favicon: 'img/favicon.svg',
url: 'https://ngocdevv.github.io',
baseUrl: '/expo-share-content/',
baseUrl: '/react-native-share-content/',
organizationName: 'ngocdevv',
projectName: 'expo-share-content',
projectName: 'react-native-share-content',
trailingSlash: false,
onBrokenLinks: 'throw',
markdown: {
Expand All @@ -27,7 +27,7 @@ const config: Config = {
breadcrumbs: true,
showLastUpdateTime: false,
editUrl:
'https://github.com/ngocdevv/expo-share-content/edit/main/docs/',
'https://github.com/ngocdevv/react-native-share-content/edit/main/docs/',
},
blog: false,
theme: {
Expand All @@ -51,25 +51,25 @@ const config: Config = {
respectPrefersColorScheme: false,
},
navbar: {
title: 'Expo Share Content',
title: 'React Native Share Content',
hideOnScroll: false,
logo: {
alt: 'Expo Share Content logo',
alt: 'React Native Share Content logo',
src: 'img/logo.svg',
},
items: [
{
href: '/expo-share-content/?section=features',
href: '/react-native-share-content/?section=features',
label: 'Features',
position: 'left',
},
{
href: '/expo-share-content/?section=showcase',
href: '/react-native-share-content/?section=showcase',
label: 'Example',
position: 'left',
},
{
href: '/expo-share-content/?section=faq',
href: '/react-native-share-content/?section=faq',
label: 'FAQ',
position: 'left',
},
Expand All @@ -80,12 +80,12 @@ const config: Config = {
position: 'right',
},
{
href: 'https://www.npmjs.com/package/expo-share-content',
href: 'https://www.npmjs.com/package/react-native-share-content',
label: 'npm',
position: 'right',
},
{
href: 'https://github.com/ngocdevv/expo-share-content',
href: 'https://github.com/ngocdevv/react-native-share-content',
label: 'GitHub',
position: 'right',
className: 'navbar-github-link',
Expand Down Expand Up @@ -121,20 +121,20 @@ const config: Config = {
items: [
{
label: 'GitHub',
href: 'https://github.com/ngocdevv/expo-share-content',
href: 'https://github.com/ngocdevv/react-native-share-content',
},
{
label: 'npm',
href: 'https://www.npmjs.com/package/expo-share-content',
href: 'https://www.npmjs.com/package/react-native-share-content',
},
{
label: 'License',
href: 'https://github.com/ngocdevv/expo-share-content/blob/main/LICENSE',
href: 'https://github.com/ngocdevv/react-native-share-content/blob/main/LICENSE',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} expo-share-content. MIT licensed.`,
copyright: `Copyright © ${new Date().getFullYear()} react-native-share-content. MIT licensed.`,
},
prism: {
theme: prismThemes.github,
Expand Down
4 changes: 2 additions & 2 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "expo-share-content-docs",
"name": "react-native-share-content-docs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Loading