|
@@ -149,6 +149,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(self.onStatusCall(_:)), name: NSNotification.Name(rawValue: Nexilis.listenerStatusCall), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(self.onStatusCall(_:)), name: NSNotification.Name(rawValue: Nexilis.listenerStatusCall), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(onReceiveMessage(notification:)), name: NSNotification.Name(rawValue: Nexilis.listenerReceiveChat), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(onReceiveMessage(notification:)), name: NSNotification.Name(rawValue: Nexilis.listenerReceiveChat), object: nil)
|
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(onCallFCM(notification:)), name: NSNotification.Name(rawValue: Nexilis.callFCM), object: nil)
|
|
|
|
|
|
view.backgroundColor = .clear
|
|
view.backgroundColor = .clear
|
|
navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
|
navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
|
@@ -375,13 +376,20 @@ class QmeraVideoViewController: UIViewController {
|
|
if ticketId.isEmpty {
|
|
if ticketId.isEmpty {
|
|
if callFCM {
|
|
if callFCM {
|
|
DispatchQueue.global().async {
|
|
DispatchQueue.global().async {
|
|
- if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getCalling(fPin: u.pin, type: "1"), timeout: 30 * 1000) {
|
|
|
|
|
|
+ if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getCalling(fPin: self.dataPerson[0]["f_pin"]!!, type: "2"), timeout: 30 * 1000) {
|
|
if response.isOk() {
|
|
if response.isOk() {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
DispatchQueue.main.async {
|
|
DispatchQueue.main.async {
|
|
- self.status.text = "Busy"
|
|
|
|
- self.end.isEnabled = false
|
|
|
|
|
|
+ if self.labelIncomingOutgoing.isDescendant(of: self.view) {
|
|
|
|
+ self.labelIncomingOutgoing.text = "Busy".localized()
|
|
|
|
+ }
|
|
|
|
+ if self.buttonDecline.isDescendant(of: self.view) {
|
|
|
|
+ self.buttonDecline.removeFromSuperview()
|
|
|
|
+ }
|
|
|
|
+ if self.buttonAccept.isDescendant(of: self.view) {
|
|
|
|
+ self.buttonAccept.removeFromSuperview()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -454,6 +462,15 @@ class QmeraVideoViewController: UIViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @objc func onCallFCM(notification: NSNotification) {
|
|
|
|
+ DispatchQueue.main.async { [self] in
|
|
|
|
+ let data:[AnyHashable : Any] = notification.userInfo!
|
|
|
|
+ if let l_pin = data["l_pin"] as? String {
|
|
|
|
+ API.initiateCCall(sParty: l_pin, nCamIdx: 1, nResIdx: 2, nVQuality: 4, ivRemoteView: listRemoteViewFix, ivLocalView: cameraView, ivRemoteZ: zoomView)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func onReceiveMessage(notification: NSNotification) {
|
|
@objc func onReceiveMessage(notification: NSNotification) {
|
|
DispatchQueue.main.async {
|
|
DispatchQueue.main.async {
|
|
let data:[AnyHashable : Any] = notification.userInfo!
|
|
let data:[AnyHashable : Any] = notification.userInfo!
|