File tree Expand file tree Collapse file tree 3 files changed +65
-3
lines changed Expand file tree Collapse file tree 3 files changed +65
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ A simple react native module to interact with OpenVPN
1313
1414| RNSimpleOpenvpn | React Native |
1515| --------------- | ------------ |
16- | 1.0.0 ~ 1.1 .0 | 0.56 ~ 0.66 |
16+ | 1.0.0 ~ 1.2 .0 | 0.56 ~ 0.66 |
1717
1818## Preview
1919
@@ -52,6 +52,37 @@ pod install
5252
5353See [ iOS Guide] ( docs/iOS-Guide.md ) for iOS side Network Extension configuration and OpenVPN integration
5454
55+ #### Disable VPN connection when app is terminated in iOS
56+
57+ Add the following to your project's ` AppDelegate.m ` :
58+
59+ ``` diff
60+ + #import "RNSimpleOpenvpn.h"
61+
62+ @implementation AppDelegate
63+
64+ // ...
65+
66+ + - (void)applicationWillTerminate:(UIApplication *)application
67+ + {
68+ + [RNSimpleOpenvpn dispose];
69+ + }
70+
71+ @end
72+ ```
73+
74+ Please make sure the Header Search Paths of Build Settings contain the following paths:
75+
76+ ``` txt
77+ $(SRCROOT)/../node_modules/react-native-simple-openvpn/ios
78+ ```
79+
80+ Or, if using CocoaPods, the following paths should be automatically included there:
81+
82+ ``` txt
83+ "${PODS_ROOT}/Headers/Public/react-native-simple-openvpn"
84+ ```
85+
5586## Example
5687
5788[ Example] ( ./example/README.md )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ A simple react native module to interact with OpenVPN
1313
1414| RNSimpleOpenvpn | React Native |
1515| --------------- | ------------ |
16- | 1.0.0 ~ 1.1 .0 | 0.56 ~ 0.66 |
16+ | 1.0.0 ~ 1.2 .0 | 0.56 ~ 0.66 |
1717
1818## 预览
1919
@@ -52,6 +52,37 @@ pod install
5252
5353iOS 端 Network Extension 配置以及 OpenVPN 的集成请参阅 [ iOS 指南] ( docs/iOS-Guide.zh-CN.md )
5454
55+ #### 后台退出 App 时关闭 VPN 连接
56+
57+ 在项目的 ` AppDelegate.m ` 中添加以下代码:
58+
59+ ``` diff
60+ + #import "RNSimpleOpenvpn.h"
61+
62+ @implementation AppDelegate
63+
64+ // ...
65+
66+ + - (void)applicationWillTerminate:(UIApplication *)application
67+ + {
68+ + [RNSimpleOpenvpn dispose];
69+ + }
70+
71+ @end
72+ ```
73+
74+ 请确保 Build Settings 的 Header Search Paths 包含以下路径:
75+
76+ ``` txt
77+ $(SRCROOT)/../node_modules/react-native-simple-openvpn/ios
78+ ```
79+
80+ 或者, 如果你使用 CocoaPods 的话,Header Search Paths 应该会自动包含以下路径:
81+
82+ ``` txt
83+ "${PODS_ROOT}/Headers/Public/react-native-simple-openvpn"
84+ ```
85+
5586## 示例
5687
5788[ 项目示例] ( ./example/README.md )
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-simple-openvpn" ,
33 "title" : " React Native Simple Openvpn" ,
4- "version" : " 1.1 .0" ,
4+ "version" : " 1.2 .0" ,
55 "description" : " React Native Open VPN Module" ,
66 "main" : " index.js" ,
77 "types" : " index.d.ts" ,
You can’t perform that action at this time.
0 commit comments