Session Callbacks

You will receive a streaming view in the LensSignallingProtocol call back like the code below.



    func renderingView(_ view: UIView?) {

        guard let renderView = view else {

            return

        }

     }

 

You will receive an appropriate session status in the below call back.



  func didChangeLensConnectionState(state: AssisLensStates) {

        switch state {

        case .connectionCompleted:

            //Connection completed

            break

        case .disconnected(let error):

          // Disconnected with error reason

            guard let lenserror = error as? 


AssisLensStates.AssistLensDisconnectState else {

                print(error?.localizedDescription ?? "empty")

                return

            }

            switch lenserror {

            case .customerEndSession, .technicianEndSession:

                DispatchQueue.main.async {

                    self.dismiss(animated: true, completion: nil)

                }

                

            default:

                break

            }

            print(lenserror)

        case .socketConnected:

            //Connection started to establised.

         break

        default:

            break

        }

   }

There are a few more callbacks you receive for actions like chat, annotation, etc.