IOS ChatSDK - Failed to observe account status updates

75 views Asked by At

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")
        }
     }

1

There are 1 answers

0
RimKtari On BEST ANSWER

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