Using ZoomSDK v. 0.16.9 (also tried .8, and .0) in the vanilla zoomapps-advancedsample-react (diff at the end)
Log of the inMeeting instance:
...
bundle.js:114 Message sent from meeting with data: "connected"
bundle.js:115 Calling postmessage... connected
...
bundle.js:114 Message sent from inMeeting with data: "/userinfo"
bundle.js:115 Calling postmessage... /userinfo
bundle.js:183 {action: 'ended', timestamp: 1678609498}
bundle.js:114 Message sent from inMeeting with data: "Goodbye"
bundle.js:115 Calling postmessage... Goodbye
...
Log of the inMainClient instance:
bundle.js:99 Meeting instance exists.
...
bundle.js:124 Message received inMainClient for tab change: Objectpayload: {payload: '/userinfo'}timestamp: 1678609463[[Prototype]]: Object
bundle.js:124 Message received inMainClient for tab change: {payload: '{\n\t"payload" : "Goodbye"\n}', timestamp: 1678609498}
...
Notice how both messages (the /userinfo
and Goodbye
) are resolved identically when being sent, but differently when received. As the result, the payload of the last message does not resolve to an object.
diff of App.js:
diff --git a/frontend/src/App.js b/frontend/src/App.js
index 35a4866..e64e48b 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -2 +2 @@
-import { useLocation, useHistory } from "react-router-dom";
+import { useLocation, /* useHistory */ } from "react-router-dom";
@@ -13 +13 @@ function App() {
- const history = useHistory();
+ // const history = useHistory();
@@ -59 +59 @@ function App() {
- version: "0.16.0",
+ version: "0.16.9",
@@ -117 +117 @@ function App() {
- let content = message.payload.payload;
+ // let content = message.payload.payload;
@@ -119 +119 @@ function App() {
- "Message received " + receiver + " " + reason + ": " + content
+ "Message received " + receiver + " " + reason + ": ", message
@@ -121 +121 @@ function App() {
- history.push({ pathname: content });
+ // history.push({ pathname: content });
@@ -128 +128 @@ function App() {
- [history]
+ [/* history */]
@@ -182,0 +183,11 @@ function App() {
+
+ useEffect(() => {
+ function onMeetingEventHandler(e) {
+ console.log(e);
+ sendMessage("Goodbye", runningContext);
+ }
+ if (!preMeeting && runningContext === "inMeeting") {
+ zoomSdk.addEventListener("onMeeting", onMeetingEventHandler);
+ return () => zoomSdk.removeEventListener("onMeeting", onMeetingEventHandler);
+ }
+ }, [preMeeting, runningContext]);