From b6f863a5048599237d5b7ea7df50e7a28a9dcb46 Mon Sep 17 00:00:00 2001 From: davidliu Date: Fri, 21 Jun 2024 13:31:38 +0900 Subject: [PATCH] fix: Handle invalidate for react-native 0.74+ (#10) * fix: Handle invalidate for react-native 0.74+ React-Native no longer calls onCatalystInstanceDestroy in 0.74+. * Fix ci --- .../src/main/java/com/oney/WebRTCModule/WebRTCModule.java | 5 +++++ examples/GumTestApp/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index f32bac9c9..cda45ba12 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -116,6 +116,11 @@ public String getName() { return "WebRTCModule"; } + @Override + public void invalidate() { + onCatalystInstanceDestroy(); + } + @Override public void onCatalystInstanceDestroy() { if (mAudioDeviceModule != null) { diff --git a/examples/GumTestApp/package.json b/examples/GumTestApp/package.json index 7bd8507e5..9dbcaade0 100644 --- a/examples/GumTestApp/package.json +++ b/examples/GumTestApp/package.json @@ -13,7 +13,7 @@ "dependencies": { "react": "18.2.0", "react-native": "0.71.4", - "react-native-webrtc": "*" + "@livekit/react-native-webrtc": "*" }, "devDependencies": { "@babel/core": "^7.20.0",