Skip to content

Commit

Permalink
we suppose to send to parent window
Browse files Browse the repository at this point in the history
  • Loading branch information
SridharaQweebi committed Dec 20, 2024
1 parent bbe2aa6 commit 8aa0a75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sim/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace pxsim.unity {

//% blockId=helloUnity block="helloUnity"
export function helloUnity(){
window.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`)
window.parent.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`)
const parent = window.parent as Record<string, any>
if (parent && typeof parent.sendMessage === "function") {
// Call the sendMessage function in the parent window
Expand Down

0 comments on commit 8aa0a75

Please sign in to comment.