Skip to content

Commit 6901a04

Browse files
committed
🐞 fix(android): 修复 RN 0.65 warning
1 parent 8d50d03 commit 6901a04

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ The following items were used in this project
229229

230230
## Todo
231231

232-
- [ ] Resolve RN 0.65 warning
232+
- [x] Resolve RN 0.65 warning
233233
- [ ] Upgrade to the latest Android OpenVPN library
234234

235235
## License

android/src/main/java/com/norcod/rnovpn/RNSimpleOpenvpnModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ private void sendEvent(String eventName, @Nullable WritableMap params) {
124124
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, params);
125125
}
126126

127+
@ReactMethod
128+
public void addListener(String eventName) {
129+
// Set up any upstream listeners or background tasks as necessary
130+
}
131+
132+
@ReactMethod
133+
public void removeListeners(Integer count) {
134+
// Remove upstream listeners, stop unnecessary background tasks
135+
}
136+
127137
@ReactMethod
128138
public void connect(ReadableMap options, Promise promise) {
129139
ovpnOptions = options.toHashMap();

0 commit comments

Comments
 (0)