interaction of push notification with tinode moved to the SDK

This commit is contained in:
or-else
2022-05-25 14:22:56 -07:00
parent 2a7c85c61c
commit a7d98136c5
7 changed files with 45 additions and 67 deletions
+1 -24
View File
@@ -7742,30 +7742,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
handlePushMessage(payload) {
const data = payload.data || {};
switch (data.what) {
case 'msg':
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.isChannelTopicName(data.topic)) {
this.tinode.oobNotification('msg', data.topic, data.seq, 'fake-uid');
}
break;
case 'read':
this.tinode.oobNotification('read', data.topic, data.seq);
break;
case 'sub':
this.tinode.oobNotification('sub', data.topic, -1, data.xfrom, {
give: data.modeGiven,
want: data.modeWant
});
break;
default:
console.warn("Unknown push type ignored", data.what, data);
}
this.tinode.oobNotification(payload.data || {});
}
initFCMessaging() {