Skip to content

Commit beb78ab

Browse files
committed
📃 docs: add Expo instructions
1 parent dfe817f commit beb78ab

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ From react-native 0.60 autolinking will take care of the link step
5252
react-native link react-native-simple-openvpn
5353
```
5454

55+
### Expo
56+
57+
If your project is based on [Expo](https://expo.dev/), you should create a **development build** locally to use this module, and then configure it according to the README
58+
59+
<https://docs.expo.dev/get-started/set-up-your-environment/?mode=development-build&buildEnv=local>
60+
61+
> Any library that is compatible with React Native is compatible with the Expo project when you create a **development build**. However, it may not be compatible with the [Expo Go](https://expo.dev/go) app
62+
5563
### Android
5664

5765
Add the following to `android/settings.gradle` :
@@ -64,6 +72,8 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
6472
include ':app'
6573
```
6674

75+
#### useLegacyPackaging
76+
6777
If your React Native version is 0.74 or higher, add the following to `android/app/build.gradle` :
6878

6979
```diff
@@ -77,6 +87,20 @@ android {
7787
}
7888
```
7989

90+
But if your project is based on [Expo](https://expo.dev/) and RN >= 0.74, please use the following modifications instead
91+
92+
```diff
93+
android {
94+
// ...
95+
packagingOptions {
96+
jniLibs {
97+
- useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
98+
+ useLegacyPackaging true
99+
}
100+
}
101+
}
102+
```
103+
80104
#### Import jniLibs
81105

82106
Due to file size limitations, jniLibs are too big to be published on npm. Use the assets on [GitHub Releases](https://github.com/ccnnde/react-native-simple-openvpn/releases/tag/v2.0.0) instead

README.zh-CN.md

+24
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ yarn add react-native-simple-openvpn
5252
react-native link react-native-simple-openvpn
5353
```
5454

55+
### Expo
56+
57+
如果你的项目基于 [Expo](https://expo.dev/),你应该在本地创建一个 **development build** 来使用这个模块,然后根据 README 进行配置
58+
59+
<https://docs.expo.dev/get-started/set-up-your-environment/?mode=development-build&buildEnv=local>
60+
61+
> Any library that is compatible with React Native is compatible with the Expo project when you create a **development build**. However, it may not be compatible with the [Expo Go](https://expo.dev/go) app
62+
5563
### Android
5664

5765
在项目的 `android/settings.gradle` 中添加以下代码:
@@ -64,6 +72,8 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
6472
include ':app'
6573
```
6674

75+
#### useLegacyPackaging
76+
6777
如果你的 React Native 版本大于等于 0.74,在项目的 `android/app/build.gradle` 中添加以下代码:
6878

6979
```diff
@@ -77,6 +87,20 @@ android {
7787
}
7888
```
7989

90+
但是如果你的项目基于 [Expo](https://expo.dev/) 且 RN 版本大于等于 0.74,请使用以下修改
91+
92+
```diff
93+
android {
94+
// ...
95+
packagingOptions {
96+
jniLibs {
97+
- useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
98+
+ useLegacyPackaging true
99+
}
100+
}
101+
}
102+
```
103+
80104
#### 导入 jniLibs
81105

82106
由于存在文件大小的限制,jniLibs 无法随模块一起发布到 npm 上。故使用 [GitHub Releases](https://github.com/ccnnde/react-native-simple-openvpn/releases/tag/v2.0.0) 中的 assets 来代替

0 commit comments

Comments
 (0)