Cross-domain messaging not working as expected in Office dialog API
We are using OfficeDialogAPI to open dialog boxes in our Office Add-in. While closing the Dialog Box, we need to send some data to the parent host and we are using Office.context.ui.messageParent & Office.EventType.DialogMessageReceived to handle the messages that come from the Dialog as shown below:
Office.context.ui.messageParent('message', { targetOrigin: '*' })
dialog.addEventHandler(Office.EventType.DialogMessageReceived, (arg) => {
console.log('Message from dialog:', arg.message);
dialog.close();
});
Since the domain is different in the parent host and in the Dialog Box, we are also setting **targetOrigin: *** so that our message is considered by Parent. (As per MS documentation provided here). But unfortunately this is working as expected and we are currently blocked on this issue.
This is not working on all three platforms we are testing - Mac, Windows & Web.
Can someone please help us here?