The URL gets parsed and passed into init method with unclosable param set to true.
The WebView should persist localStorage and sessionStorage
Expected URL params:
eyezon - to immediately trigger the widget
businessId - required
buttonId - used for loading settings and routing to appropriate streamers, defaults to first buttonId in admin area
target - unique chat intent identifier, required in WebViews
title - chat title, required in WebViews
putInCart - enable put in cart functionality for the new dialog
productUrl - referrer url, used in statistics and for opening chat origin page in mobile apps (defaults to the current url up to ?, - window.location.href.split("?")[0])
autoSubmit - if not empty, attempts to start new dialog with the provided text
eyezonRegion - backend region, defaults to "ru-1"
language - defaults to navigator.language on this page
name - passed to setDefaultClientField
phone - passed to setDefaultClientField, needs to start with encoded plus if a mask is used
email - passed to setDefaultClientField
clientId - passed to setAnalyticsParam (host website clientId, - not ours)
region - passed to setAnalyticsParam
See embedding.md for push messaging params. E.g.:
&fcmToken=...&application=ANDROID_SDK
&apnToken=...&application=IOS_SDK
Stars a new dialog if the previous dialog for the target has been closed; or there are no dialogs for the target
The client can always navigate to dialog list by clicking on the arrow in top left corner.
The opening url format:
webview.html?eyezon&businessId=<businessId>&language=<language>&buttonId=<buttonId>&target=<target>&title=<title>
Opening by dialog ID
Used for restoring specific dialogs from push-messages.
Opens the provided dialogId even if the dialog is closed.
The restoration url format:
webview.html?open=true&businessId=<businessId>&language=<language>&buttonId=<buttonId>&userId=<userId>&dialogId=<dialogId>¬ificationType=push
Putting in cart details can be extracted from PUT_IN_CART_FROM_WIDGET
eyeZon('on', 'PUT_IN_CART_FROM_WIDGET', () => {}) - handler must exist on the host page for put in cart functionality to work and the current dialog must have been created with putInCart set to true