0
Answered

sayText in iframe

info 1 year ago in SitePal Silver updated by Gil Sideman 1 year ago 6

Hello,


how can I trigger the sayText function if i added the avatar with iframe?

Answer

Answer

We put together a simple React code example that demonstrates loading the SitePal character in an iframe and using API calls. As long as both host page and frame page are loaded from the same domain, this should work fine.

Download code example here - 

www.workboy.com/examples/react-iframe/IframeExample.zip

Hope this helps,

Gil

The SitePal Team

Under review

Hello !

When the SitePal embed code is placed in an iFrame - you need to setup as "licensed domain" both the domains:

- the frame page domain

- the host page domain


Please try and let us know if you still see a problem.

Regards,

Gil 

The SitePal Team

Hello,

i currently tested the avatar with the normal npm package and the resulting SitePal component. There the sayText works normally. With iframe the function is not available. How can I trigger it in react? Do you have a sample code?

Answer

We put together a simple React code example that demonstrates loading the SitePal character in an iframe and using API calls. As long as both host page and frame page are loaded from the same domain, this should work fine.

Download code example here - 

www.workboy.com/examples/react-iframe/IframeExample.zip

Hope this helps,

Gil

The SitePal Team

If not possible with Iframe, can you please ask your team how to map these values to the component like this. Currently it throws an error:

<SitePal
    embed={`${sitePalX},600,800,"",1,1, ${sitePalY},0,1,1,"${sitePalZ}",1,0`}
/>

Thank you very much!