From bbe2aa62af8214bbac962ce979cc9bff4d2a7b44 Mon Sep 17 00:00:00 2001 From: SridharaQweebi <85789105+SridharaQweebi@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:45:09 +0530 Subject: [PATCH] using post to send msg --- sim/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/api.ts b/sim/api.ts index d896b5a0..31f7fab4 100644 --- a/sim/api.ts +++ b/sim/api.ts @@ -30,11 +30,11 @@ namespace pxsim.unity { //% blockId=helloUnity block="helloUnity" export function helloUnity(){ + window.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`) const parent = window.parent as Record if (parent && typeof parent.sendMessage === "function") { // Call the sendMessage function in the parent window console.log("MakeCode: calling parent function.."); - window.parent.postMessage("SendMsg", "") parent.sendMessage(`SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`) } else