A sample Android project showcasing how to embed Twyla Widget in an activity:
- Grab the widget configuration from Twyla Canvas Widget configurator (Project settings -> Twyla Web Widget -> Generate Snippet).
- Add the embed attribute
data-embed-mode="true"
to the script. It should look something like:
<script
id="twyla-widget-script"
src="https://widget.chat.twyla.ai/twyla-widget.js"
data-hook-url="<hook-url>"
data-api-key="<api-key>"
data-primary-color="#2f80ed"
data-greeting="false"
data-embed-mode="true"
>
</script>
- Import the Project in Android Studio.
- In
assets/index.html
, replace the script with the one from step #2. - Run the project