From f21545e700a8510362901c590352fd53d6adb23b Mon Sep 17 00:00:00 2001 From: Valentyn Pshoniuk Date: Thu, 19 Oct 2023 12:00:59 +0300 Subject: [PATCH] docs: add Expo integration guide --- app.plugin.js | 8 ++++++++ docs/expo-integration.md | 26 ++++++++++++++++++++++++++ docs/getting-started.md | 3 +++ package.json | 1 + 4 files changed, 38 insertions(+) create mode 100644 app.plugin.js create mode 100644 docs/expo-integration.md diff --git a/app.plugin.js b/app.plugin.js new file mode 100644 index 0000000..66b9006 --- /dev/null +++ b/app.plugin.js @@ -0,0 +1,8 @@ +const withGiphyRNSdk = (config) => { + if (!config.ios) config.ios = {} + if (!config.ios.infoPlist) config.ios.infoPlist = {} + + return config +} + +module.exports = withGiphyRNSdk diff --git a/docs/expo-integration.md b/docs/expo-integration.md new file mode 100644 index 0000000..c5ec9e9 --- /dev/null +++ b/docs/expo-integration.md @@ -0,0 +1,26 @@ +# Expo Installation + +> This package cannot be used in the "Expo Go" app +> because [it requires custom native code](https://docs.expo.dev/workflow/customizing/). + +First install the package with yarn, npm, or [`npx expo install`](https://docs.expo.dev/more/expo-cli/#installation). + +```sh +expo install @giphy/react-native-sdk +``` + +After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to +the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`: + +```json +{ + "expo": { + "plugins": [ + "@giphy/react-native-sdk" + ] + } +} +``` + +Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.dev/workflow/customizing/) +guide. diff --git a/docs/getting-started.md b/docs/getting-started.md index a9646e5..c033bef 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -16,6 +16,9 @@ ### Installation +> 🚨 Expo: This package is not available in the [Expo Go](https://expo.io/client) app. Learn how you can use it +> with [custom dev clients](./expo-integration.md). + ```bash yarn add @giphy/react-native-sdk ``` diff --git a/package.json b/package.json index 1308bc7..67da3ba 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "ios", "cpp", "giphy-react-native-sdk.podspec", + "app.plugin.js", "!lib/typescript/example", "!android/build", "!ios/build",