Skip to content

Commit

Permalink
fix: custom url scheme is mandatory (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
achorein authored Feb 22, 2024
1 parent 610ddef commit 171b07a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ Share intent in a native module for Expo (React Native).

## Installation

Install npm package
**Install npm package**

```bash
yarn add expo-share-intent
# or
npm install expo-share-intent
```

add expo plugin into your `app.json`
**Into your `app.json`:**

- add expo plugin

```json
"plugins": [
Expand All @@ -39,6 +41,14 @@ add expo plugin into your `app.json`

> by default only text and url sharing is activated
- configure a custom URL scheme

```json
"scheme": "my-app"
```

> More info here : [Linking to your app](https://docs.expo.dev/guides/linking/#linking-to-your-app)
## Usage

#### Use the hook in your App
Expand Down
5 changes: 5 additions & 0 deletions plugin/src/ios/writeIosShareExtensionFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ export function getShareExtensionViewControllerContent(
console.debug(
`[expo-share-intent] add ios share extension (scheme:${scheme} appIdentifier:${appIdentifier})`
);
if (!scheme) {
throw new Error(
"[expo-share-intent] missing custom URL scheme 'expo.scheme' in app.json ! (see https://docs.expo.dev/guides/linking/#linking-to-your-app)"
);
}

const content = fs.readFileSync(
path.resolve(__dirname, "./ShareExtensionViewController.swift"),
Expand Down

0 comments on commit 171b07a

Please sign in to comment.