Hi,
We have an integration between a CRM and the Genesys Embeddable framework app, which has been working well for quite some time now. Recently we decided to improve it, which requires some changes to the framework.js file. However we are stuck on testing these updates.
We are testing our framework.js file with the help of the GitHub test project at: GitHub - MyPureCloud/purecloud-embeddable-framework-example
And the main thing we want to test are postMessage events that we have added. However, we don't see any events coming in when debugging from the browser (Chrome / Firefox) in the framework.js file.
We have set up the example.html to contain an additional iframe. So we have the original iframe containing the Embeddable framework app, and a second iframe with an app module we created, which is running on our server.
For testing, we load the app via the 'node server.js' command from powershell, and view the app in the browser at https://localhost/example.html. When the app is loaded it sets a timeout and then sends a test message. This message is received in the module we created. So the communication is working in that direction.
},
initialSetup: function () {
console.log("[Purecloud App] inital setup is launched");
setTimeout(function () {
const message = {
type: "test",
content: ""
}
window.parent.frames[1].postMessage(message, "*");
}, 5000);
window.addEventListener("message", function (event) {
try {
console.log('[Purecloud App][framework JS] Received Event', event);
var message = JSON.parse(event.data);
if (message) {
if (message.type == "clickToDial") {
-- side note, to those familiar with the example code, we have moved the subscriptions section to a seperate function, which should now be triggered by one of the new message events. --
However, messages going from the module to the framework.js do not seem to arrive.
We do know this multi iframe setup works, because it is already live and running for our customers.
Also, when we use the framework.js file that is currently live, so without the updates, we also do not see any postMessage events coming in when testing locally.
Does anyone have an idea on how we can test the events received on the framework.js side?