Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: custom url scheme is mandatory #3

Merged
merged 1 commit into from
Feb 22, 2024
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
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
Loading