Search code examples
iosswiftxcode12zendesk-appzendesk-sdk

IOS ChatSDK - Failed to observe account status updates


Im trying to observe the agent status every time I change it from the zendesk Dashboard, but its not working for me. Im just able to get it once for the first time that Im launching the view .

How can I make it reactive and get the updates of the status please.

I used this function :


    Chat.accountProvider?.observeAccount { (account) in
    
    switch account.accountStatus {
    
       case .online :
         print("agent is online") 
       case .offline :
         print("agent is offline")
        }
     }


Solution

  • Its fixed now. I just called Chat.connectionProvider?.connect() in didFinishLaunchingWithOptions function of AppDelegate.swift file.