android {...// Configure only for each module that uses Java 8// language features (either in its source code or// through dependencies). compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }}
protected voidonCreate(Bundle savedInstanceState) {... // new Alli(String apiKey, WebView webView, AlliEventHandler eventHandler, boolean showHeader, boolean showFooter, boolean showBackButton)
// 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 =newAlli("YOUR_API_KEY", webView,this,true,true,false);alli.initialize();...}
public protocol AlliEventHandler {// Called when initialized successfully.// You may receive NOT_INITIALIZE_YET error if// called before this event.voidonInitialized(WebView view);// Called when chat started successfully.voidonConversationStarted(WebView view, String userId, String placement, Object context);// Called when conversation did not start// even when Alli.event was called.voidonConversationNotStarted(_ view: WKWebView!, userId: String, placement: String, context: Any?)// Called when user has closed the chat// window or Alli.close() is called.voidonConversationClosed(WebView view, String userId, String placement, Objective context)voidonError(WebView view, AlliErrorCode errorCode, String userId, String placement, Object context)}