Key takeaways
- Embed the chat in a WebView – a simple hosted HTML page that loads the AskSpot script.
- The script URL carries your project ID; add
?open=trueto open the chat on load. - You can listen for
chat_closedto react when the user closes the chat. - Swap the example IDs for your own project and assistant IDs from AskSpot.
What this does
A WebView shows a web page inside your native app. By pointing it at a small page that loads the AskSpot chat, your app users get the same assistant your website has – without a native SDK. You host one HTML file and reference it from the WebView.
Before you start
- Your AskSpot project ID and assistant ID (from AskSpot).
- Somewhere to host a small HTML file, and a WebView in your app.
Step 1 – Create the HTML page
Make a simple HTML page that loads the AskSpot embed script. Adding ?open=true opens the chat as soon as the page loads – which is usually what you want inside a WebView:
<script crossorigin="*" async src="https://chat.askspot.io/api/v1/integration/<your-project-id>/embed-script?open=true"></script>
Host this page somewhere you control.
Step 2 – Point your WebView at it
In your app, set the WebView’s URL to the page you just hosted. That is enough to show the chat in the app.
Step 3 – (Optional) Detect when the chat closes
If your app needs to react when the user closes the chat – for example to hide the WebView – listen for the chat_closed event:
AskWidget["<your-assistant-id>"].addEventListener("chat_closed", (event) => {
console.log("chat closed", event);
});
Swap in your own IDs. Replace <your-project-id> in the script URL and <your-assistant-id> in the listener with the IDs from your AskSpot account – they identify your project and the specific assistant.
This mobile setup is part of a custom integration – see that page for the full picture.
Do I need a native SDK?
No. The chat runs in a WebView pointed at a small HTML page that loads the AskSpot script – no native SDK required.
How do I open the chat automatically?
Add ?open=true to the embed-script URL, so the chat opens as soon as the WebView loads the page.
Where do I get the project and assistant IDs?
From your AskSpot account. The project ID goes in the script URL; the assistant ID is used in the chat_closed listener.








