|
|
@@ -88,6 +88,11 @@ export default {
|
|
|
// 收到会话列表更新通知,可通过遍历 event.data 获取会话列表数据并渲染到页面
|
|
|
// event.name - TIM.EVENT.CONVERSATION_LIST_UPDATED
|
|
|
// event.data - 存储 Conversation 对象的数组 - [Conversation]
|
|
|
+ if (window.ReactNativeWebView) {
|
|
|
+ window.ReactNativeWebView.postMessage(
|
|
|
+ JSON.stringify(event),
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
this.tim.on(TIM.EVENT.GROUP_LIST_UPDATED, function(event) {
|
|
|
@@ -121,12 +126,23 @@ export default {
|
|
|
// event.name - TIM.EVENT.ERROR
|
|
|
// event.data.code - 错误码
|
|
|
// event.data.message - 错误信息
|
|
|
+ if (window.ReactNativeWebView) {
|
|
|
+ window.ReactNativeWebView.postMessage(
|
|
|
+ JSON.stringify(event),
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
this.tim.on(TIM.EVENT.SDK_NOT_READY, function(event) {
|
|
|
// 收到 SDK 进入 not ready 状态通知,此时 SDK 无法正常工作
|
|
|
- // event.name - TIM.EVENT.SDK_NOT_READY
|
|
|
+ // event.name - TIM.EVENT.SDK_NOT_READY
|
|
|
+
|
|
|
+ if (window.ReactNativeWebView) {
|
|
|
+ window.ReactNativeWebView.postMessage(
|
|
|
+ JSON.stringify(event),
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|