Hi Eric,
You are right, the whitelisting did not work, please try again.
To control the viewer from the configurator you need to first include the viewer on the configurator page via an iframe with a code like this.
Then you can send commands to the viewer index.html
using the JavaScript postMessage
API. The configurator can do something like:
iframe.contentWindow.postMessage('yourmessagecontent',
https://sundial.shapespark.com');
And in the viewer index.html
can receive these messages:
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
if (event.origin !== "https://configuratordomain") {
return;
}
// Handle the message
}
This a standard mechanism for communicating between a page and an iframe, it is not a part of Shapespark API. The idea is that if a user for example selects a floor material from your configurator interface, the configurator will send a message to the viewer to change the floor material.
To be able to do anything useful in response to such messages we will need to at least add a function that would allow you to find a material by name. Can you talk with the developer what kind of operations you would like to perform, so we know if some other functions need to be also added?