var alli:Alli?override func viewDidLoad() {// showHeader - optional, default: true, If you want to remove the header, turn off this option.// showFooter - optional, default: true, If you want to remove the footer, turn off this option. // showBackButton - optional, default: true, If you want to remove the back button on the header, turn off this option.
alli =Alli("YOUR_API_Key", eventHandler: self, showHeader: true, showFooter: true, showBackButton: false)}
import WebKitpublic protocol AlliEventHandler {// Called when initialized successfully.// You may receive NOT_INITIALIZE_YET error if// called before this event. func onInitialized(_ view:WKWebView!)// Called when chat started successfully. func onConversationStarted(_ view: WKWebView!, userId: String, placement: String, context: Any?)// Called when conversation did not start// even when Alli.event was called. func onConversationNotStarted(_ view: WKWebView!, userId: String, placement: String, context: Any?)// Called when user has closed the chat// window or Alli.close() is called. func onConversationStopped(_ view: WKWebView!, userId: String, placement: String, context: Any?) func onError(_ view: WKWebView!, errorCode: AlliErrorCode, userId:String?, placement:String?, context:Any?) }