//
//  APIS.swift
//  example_code_react_native
//
//  Created by Akhmad Al Qindi Irsyam on 27/06/23.
//

import Foundation
import NexilisLite

@objc(CallNative)
class CallNative: NSObject, ConnectDelegate {
  func onSuccess(userId: String) {
    
  }
  
  func onFailed(error: String) {
    
  }
  
  @objc func connect() {
    //FLOATING
    APIS.connect(apiKey: "***REPLACE***WITH***YOUR***ACCOUNT***", delegate: self, showButton: false)
  }
  
  @objc func openContactCenter() {
    DispatchQueue.main.async {
      APIS.openContactCenter()
    }
  }
  @objc func openChat() {
    DispatchQueue.main.async {
      APIS.openChat()
    }
  }
  @objc func openCall() {
    DispatchQueue.main.async {
      APIS.openCall()
    }
  }
  @objc func openStreaming() {
    DispatchQueue.main.async {
      APIS.openStreaming()
    }
  }
  @objc func openSetting() {
    DispatchQueue.main.async {
      APIS.openSetting()
    }
  }
  @objc func openWhiteboard() {
    DispatchQueue.main.async {
      APIS.openWhiteboard()
    }
  }
  @objc func openScreenSharing() {
    DispatchQueue.main.async {
      APIS.openScreenSharing()
    }
  }
  @objc(openContactCenterChat:)
  func openContactCenterChat(category: Int) {
    print("category \(category)")
    DispatchQueue.main.async {
      APIS.openContactCenter(media: 0, category: category)
    }
  }
  @objc(openContactCenterAudioCall:)
  func openContactCenterAudioCall(category: Int) {
    DispatchQueue.main.async {
      APIS.openContactCenter(media: 1, category: category)
    }
  }
  @objc(openContactCenterVideoCall:)
  func openContactCenterVideoCall(category: Int) {
    DispatchQueue.main.async {
      APIS.openContactCenter(media: 2, category: category)
    }
  }
  @objc(signInAdmin:)
  func signInAdmin(pwd: String) {
    DispatchQueue.main.async {
      APIS.signInAdmin(password: pwd)
    }
  }
  @objc func openSetOfficer() {
    DispatchQueue.main.async {
      APIS.openSetAsOfficerForm()
    }
  }
}
