alqindiirsyam 2 anni fa
parent
commit
03f499806c

+ 5 - 2
appbuilder-ios/AppBuilder/AppBuilder/SecondTabViewController.swift

@@ -349,11 +349,14 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
         getChats {
             self.getContacts {
                 self.getGroups { g1 in
+                    self.groups.removeAll()
+                    self.groups.append(contentsOf: g1)
+                    DispatchQueue.main.async {
+                        self.tableView.reloadData()
+                    }
                     DispatchQueue.global().async {
                         self.getOpenGroups(listGroups: g1, completion: { g in
                             DispatchQueue.main.async {
-                                self.groups.removeAll()
-                                self.groups.append(contentsOf: g1)
                                 for og in g {
                                     if self.groups.first(where: { $0.id == og.id }) == nil {
                                         self.groups.append(og)

+ 1 - 0
appbuilder-ios/NexilisLite/NexilisLite/Resource/id.lproj/Localizable.strings

@@ -172,3 +172,4 @@
 "Accept Call" = "Terima Panggilan";
 "Call Center History" = "Riwayat Pusat Panggilan";
 "User" = "Pengguna";
+"Friends" = "Teman";

+ 22 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -1281,6 +1281,17 @@ extension Nexilis: CallDelegate {
                 if !onGoingCC.isEmpty {
                     videoController.isAutoAccept = true
                     DispatchQueue.main.asyncAfter(deadline: .now() + isShowAlert!, execute: {
+                        if UIApplication.shared.visibleViewController is UIAlertController {
+                            let vc = UIApplication.shared.visibleViewController as! UIAlertController
+                            vc.dismiss(animated: true, completion: {
+                                if UIApplication.shared.visibleViewController?.navigationController != nil {
+                                    UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
+                                } else {
+                                    UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
+                                }
+                            })
+                            return
+                        }
                         if UIApplication.shared.visibleViewController?.navigationController != nil {
                             UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
                         } else {
@@ -1288,6 +1299,17 @@ extension Nexilis: CallDelegate {
                         }
                     })
                 } else {
+                    if UIApplication.shared.visibleViewController is UIAlertController {
+                        let vc = UIApplication.shared.visibleViewController as! UIAlertController
+                        vc.dismiss(animated: true, completion: {
+                            if UIApplication.shared.visibleViewController?.navigationController != nil {
+                                UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
+                            } else {
+                                UIApplication.shared.visibleViewController?.present(navigationController, animated: true, completion: nil)
+                            }
+                        })
+                        return
+                    }
                     if UIApplication.shared.visibleViewController?.navigationController != nil {
                         UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
                     } else {

+ 15 - 3
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/CallProviderDelegate.swift

@@ -109,11 +109,23 @@ extension CallProviderDelegate: CXProviderDelegate {
             controller.isOnGoing = true
             controller.isOutgoing = false
             controller.modalPresentationStyle = .overCurrentContext
-            if UIApplication.shared.visibleViewController?.navigationController != nil {
-                UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
+            if UIApplication.shared.visibleViewController is UIAlertController {
+                let vc = UIApplication.shared.visibleViewController as! UIAlertController
+                vc.dismiss(animated: true, completion: {
+                    if UIApplication.shared.visibleViewController?.navigationController != nil {
+                        UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
+                    } else {
+                        UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
+                    }
+                })
             } else {
-                UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
+                if UIApplication.shared.visibleViewController?.navigationController != nil {
+                    UIApplication.shared.visibleViewController?.navigationController?.present(controller, animated: true, completion: nil)
+                } else {
+                    UIApplication.shared.visibleViewController?.present(controller, animated: true, completion: nil)
+                }
             }
+            
         }
     }
     

+ 6 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/QmeraAudioViewController.swift

@@ -204,7 +204,13 @@ class QmeraAudioViewController: UIViewController {
         return button
     }()
     
+    override func viewWillDisappear(_ animated: Bool) {
+        UIDevice.current.isProximityMonitoringEnabled = false
+        NotificationCenter.default.removeObserver(self)
+    }
+    
     deinit {
+        UIDevice.current.isProximityMonitoringEnabled = false
         NotificationCenter.default.removeObserver(self)
     }
     

+ 16 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Call/QmeraVideoViewController.swift

@@ -468,6 +468,20 @@ class QmeraVideoViewController: UIViewController {
     }
     
     @objc func didTapAcceptCallButton(){
+        let goAudioCall = Nexilis.checkMicPermission()
+        let goVideoCall = Nexilis.checkCameraPermission()
+        if goVideoCall == 0 {
+            let alert = UIAlertController(title: "Attention!".localized(), message: !goAudioCall && goVideoCall == 0 ? "Please allow microphone & camera permission in your settings".localized() : !goAudioCall ? "Please allow microphone permission in your settings".localized() : "Please allow camera permission in your settings", preferredStyle: .alert)
+            alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {_ in
+                if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
+                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
+                }
+            }))
+            self.navigationController?.present(alert, animated: true, completion: nil)
+            return
+        } else if goVideoCall == -1 {
+            return
+        }
         Nexilis.startAudio(nMode: 2, bSpeakerOn: true)
         API.receiveCCall(sParty: dataPerson[0]["f_pin"]!, nCamIdx: 1, nResIdx: 2, nVQuality: 4, ivRemoteView: listRemoteViewFix, ivLocalView: cameraView,ivRemoteZ: zoomView)
         DispatchQueue.main.async {
@@ -918,6 +932,8 @@ class QmeraVideoViewController: UIViewController {
             } else if self.dataPerson.count > 1 {
                 DispatchQueue.main.async {
                     for i in 0..<self.dataPerson.count {
+//                        self.listRemoteViewFix[i].image = self.listRemoteViewFix[i].image?.rotate(radians: (CGFloat.pi * 3 )/2)
+                        self.listRemoteViewFix[i].image = nil
                         if self.dataPerson[i]["user_type"] == "2" || arrayMessage[5] == "2" {
                             self.listRemoteViewFix[i].transform = CGAffineTransform.init(scaleX: 1.4, y: 1.3).rotated(by: (CGFloat.pi)/2)
                         } else {

+ 5 - 2
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -227,10 +227,13 @@ class ContactChatViewController: UITableViewController {
         getChats {
             self.getContacts {
                 self.getGroups { g1 in
+                    self.groups.removeAll()
+                    self.groups.append(contentsOf: g1)
+                    DispatchQueue.main.async {
+                        self.tableView.reloadData()
+                    }
                     DispatchQueue.global().async {
                         self.getOpenGroups(listGroups: g1, completion: { g in
-                            self.groups.removeAll()
-                            self.groups.append(contentsOf: g1)
                             for og in g {
                                 if self.groups.first(where: { $0.id == og.id }) == nil {
                                     self.groups.append(og)