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
13
13
14
14
| RNSimpleOpenvpn | React Native |
15
15
| --------------- | ------------ |
16
- | 1.0.0 ~ 1.1 .0 | 0.56 ~ 0.66 |
16
+ | 1.0.0 ~ 1.2 .0 | 0.56 ~ 0.66 |
17
17
18
18
## Preview
19
19
@@ -52,6 +52,37 @@ pod install
52
52
53
53
See [ iOS Guide] ( docs/iOS-Guide.md ) for iOS side Network Extension configuration and OpenVPN integration
54
54
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
+
55
86
## Example
56
87
57
88
[ 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
13
13
14
14
| RNSimpleOpenvpn | React Native |
15
15
| --------------- | ------------ |
16
- | 1.0.0 ~ 1.1 .0 | 0.56 ~ 0.66 |
16
+ | 1.0.0 ~ 1.2 .0 | 0.56 ~ 0.66 |
17
17
18
18
## 预览
19
19
@@ -52,6 +52,37 @@ pod install
52
52
53
53
iOS 端 Network Extension 配置以及 OpenVPN 的集成请参阅 [ iOS 指南] ( docs/iOS-Guide.zh-CN.md )
54
54
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
+
55
86
## 示例
56
87
57
88
[ 项目示例] ( ./example/README.md )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-simple-openvpn" ,
3
3
"title" : " React Native Simple Openvpn" ,
4
- "version" : " 1.1 .0" ,
4
+ "version" : " 1.2 .0" ,
5
5
"description" : " React Native Open VPN Module" ,
6
6
"main" : " index.js" ,
7
7
"types" : " index.d.ts" ,
You can’t perform that action at this time.
0 commit comments