ZohoSalesIQDelegate

The Mobilisten iOS SDK provides a delegate for various event callbacks to help developers track different actions performed by the app user.

Implementation

To start receiving various events within the Mobilisten, your class must conform to the  ZohoSalesIQDelegate protocol. Then, set an instance of your class to the  ZohoSalesIQ.delegate property to set your class as the delegate.

Supported event callbacks

MethodInvoked when
agentsOnline:operators or bots are available to pick up new incoming chats
agentsOffline:no operators or bots are available to pick up new incoming chats 
supportOpened:the Mobilisten UI is opened 
supportClosed:the Mobilisten UI is closed
chatViewOpened:the chat window is opened
chatViewClosed:a chat window is closed
homeViewOpened:the home view with conversations list and FAQs is opened
homeViewClosed:the home view with conversations list and FAQs is closed
visitorIPBlocked:an operator or bot blocks the IP of the user
handleTriggera custom trigger is executed. Learn more.
handleBotTriggera bot has been triggered
handleCustomLauncherVisibilityShow/hide your custom launcher with the triggered boolean value

Setting the delegate

Copiedlet myEventHandler = MyEventHandler()
ZohoSalesIQ.delegate = myEventHandler

Implementation

Copiedclass MyEventHandler: ZohoSalesIQDelegate {
    
    func agentsOnline() {
        // your code goes here
    }
    
    func agentsOffline() {
        // your code goes here
    }
    
    func supportOpened() {
        // your code goes here
    }
    
    func supportClosed() {
        // your code goes here
    }
    
    func chatViewOpened(id: String?) {
        // your code goes here
    }
    
    func chatViewClosed(id: String?) {
        // your code goes here
    }
    
    func homeViewOpened() {// your code goes here
    }
    
    func homeViewClosed() {
        // your code goes here
    }
    
    func visitorIPBlocked() {
        // your code goes here
    }
    
    func handleTrigger(name: String, visitorInformation: SIQVisitor) {
        if name == "custom_trigger"{
            // your code goes here
        }
    }
    
    func handleBotTrigger() {
        // your code goes here
    }

     func handleCustomLauncherVisibility(_ visible: Bool) {
        // your code goes here        
     }
}