alqindiirsyam 2 éve
szülő
commit
777941d5ff

+ 49 - 10
appbuilder-ios/DigiXLite/DigiXLite/Source/DigiX.swift

@@ -82,6 +82,31 @@ public class DigiX: NSObject {
     public static let OFFLINE = -3
     public static let BUSY = -4
     
+    public static let IDX_QUEUE_SYSTEM = 2
+    public static let IDX_NOTIF_CENTER = 3
+    public static let IDX_CC_STREAM = 4
+    public static let IDX_CHAT = 6
+    public static let IDX_CALL = 7
+    public static let IDX_STREAM = 8
+    public static let IDX_CC = 9
+    public static let IDX_CALL_AUDIO = 11
+    public static let IDX_CALL_VIDEO = 12
+    public static let IDX_WHITEBOARD = 13
+    public static let IDX_SCREENSHARING = 14
+    public static let IDX_WB_SS = 15
+    public static let IDX_BROADCAST_FORM = 16
+    public static let IDX_CONVERSATION = 17
+    public static let IDX_FAVORITEMESSAGE = 18
+    public static let IDX_CONFERENCE_ROOM_FORM = 19
+    public static let IDX_EMAIL_CONFIGURATION = 20
+    public static let IDX_CREATE_GROUP = 21
+    public static let IDX_ADDFRIEND = 22
+    public static let IDX_SIGNUP_OR_IN_PAGE = 23
+    public static let IDX_POST = 99
+    public static let IDX_SELF_ACT = 100
+    public static let IDX_SOCIAL_COMMERCE = 101
+    public static let IDX_NEWS = 102
+    
     private func createDelegate() {
         //print(("createDelegate...")
         callDelegate = self
@@ -669,21 +694,35 @@ public class DigiX: NSObject {
     }
 
     public static func buttonClicked(index: Int, id: String = "") {
-        //print(("BTNCLICK \(index) \(id)")
-        if index == 2 {
-            DigiX.openUrl(url: id)
-        } else if index == 3 {
+        //print("BTNCLICK \(index) \(id)")
+        if index == IDX_QUEUE_SYSTEM || index == IDX_NEWS || index == IDX_SOCIAL_COMMERCE {
+            openUrl(url: id)
+        } else if index == IDX_NOTIF_CENTER {
             APIS.openNotificationCenter()
-        } else if index == 6 {
-            APIS.startConversation()
-        } else if index == 7 {
+        } else if index == IDX_CHAT {
+            APIS.openChat()
+        } else if index == IDX_CALL {
             APIS.openCall()
-        } else if index == 8 {
+        } else if index == IDX_STREAM {
             APIS.openStreaming()
-        } else if index == 9 {
+        } else if index == IDX_CC {
             APIS.openContactCenter()
+        } else if index == IDX_ADDFRIEND {
+            APIS.openAddFriend()
+        } else if index == IDX_WB_SS {
+            APIS.openWhiteboardAndScreenSharing()
+        } else if index == IDX_WHITEBOARD {
+            APIS.openWhiteboard()
+        } else if index == IDX_SCREENSHARING {
+            APIS.openWhiteboardAndScreenSharing()
+        } else if index == IDX_POST {
+            
+        } else if index == IDX_CONVERSATION {
+            APIS.startConversation()
+        } else if index == IDX_FAVORITEMESSAGE {
+            APIS.openFavoriteMessage()
         } else {
-            DigiX.openApp(id: id)
+            openApp(id: id)
         }
     }
     

+ 31 - 5
appbuilder-ios/DigiXLite/DigiXLite/Source/FloatingButton/FloatingButton.swift

@@ -151,11 +151,37 @@ public class FloatingButton: UIView {
                                         let newButton = UIButton()
                                         newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
                                         newButton.translatesAutoresizingMaskIntoConstraints = false
-                                        DispatchQueue.global().async {
-                                            let data = try? Data(contentsOf: URL(string: "https://newuniverse.io/get_file?account=\(DigiX.sAPIKey)&image=\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
-                                            DispatchQueue.main.async {
-                                                if data != nil {
-                                                    newButton.setImage(UIImage(data: data!), for: .normal)
+                                        if icon.isEmpty {
+                                            var indexTap = 0
+                                            if package_id.contains("_fb"){
+                                                indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
+                                            }
+                                            if indexTap == DigiX.IDX_CHAT {
+                                                newButton.setImage(UIImage(named: "pb_button_chat", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_CALL {
+                                                newButton.setImage(UIImage(named: "pb_button_call", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_CC {
+                                                newButton.setImage(UIImage(named: "pb_button_cc", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_STREAM {
+                                                newButton.setImage(UIImage(named: "pb_button_stream", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_SOCIAL_COMMERCE {
+                                                newButton.setImage(UIImage(named: "pb_button_commerce", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_NEWS {
+                                                newButton.setImage(UIImage(named: "pb_button_news", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_POST {
+                                                newButton.setImage(UIImage(named: "pb_button_post", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else if indexTap == DigiX.IDX_NOTIF_CENTER {
+                                                newButton.setImage(UIImage(named: "pb_button_notification", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            } else {
+                                                newButton.setImage(UIImage(named: "pb_button_others", in: Bundle.resourceBundle(for: DigiX.self), with: nil), for: .normal)
+                                            }
+                                        } else {
+                                            DispatchQueue.global().async {
+                                                let data = try? Data(contentsOf: URL(string: "https://newuniverse.io/get_file?account=\(DigiX.sAPIKey)&image=\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                                                DispatchQueue.main.async {
+                                                    if data != nil {
+                                                        newButton.setImage(UIImage(data: data!), for: .normal)
+                                                    }
                                                 }
                                             }
                                         }

+ 3 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/View/Chat/EditorGroup.swift

@@ -4043,7 +4043,9 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)

+ 3 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/View/Chat/EditorPersonal.swift

@@ -5428,7 +5428,9 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)

+ 3 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/View/Chat/EditorStarMessages.swift

@@ -800,7 +800,9 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)

+ 31 - 5
appbuilder-ios/NexilisLite/NexilisLite/Source/FloatingButton/FloatingButton.swift

@@ -151,11 +151,37 @@ public class FloatingButton: UIView {
                                         let newButton = UIButton()
                                         newButton.heightAnchor.constraint(equalToConstant: 40).isActive = true
                                         newButton.translatesAutoresizingMaskIntoConstraints = false
-                                        DispatchQueue.global().async {
-                                            let data = try? Data(contentsOf: URL(string: "https://newuniverse.io/get_file?account=\(Nexilis.sAPIKey)&image=\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
-                                            DispatchQueue.main.async {
-                                                if data != nil {
-                                                    newButton.setImage(UIImage(data: data!), for: .normal)
+                                        if icon.isEmpty {
+                                            var indexTap = 0
+                                            if package_id.contains("_fb"){
+                                                indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
+                                            }
+                                            if indexTap == Nexilis.IDX_CHAT {
+                                                newButton.setImage(UIImage(named: "pb_button_chat", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_CALL {
+                                                newButton.setImage(UIImage(named: "pb_button_call", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_CC {
+                                                newButton.setImage(UIImage(named: "pb_button_cc", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_STREAM {
+                                                newButton.setImage(UIImage(named: "pb_button_stream", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_SOCIAL_COMMERCE {
+                                                newButton.setImage(UIImage(named: "pb_button_commerce", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_NEWS {
+                                                newButton.setImage(UIImage(named: "pb_button_news", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_POST {
+                                                newButton.setImage(UIImage(named: "pb_button_post", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else if indexTap == Nexilis.IDX_NOTIF_CENTER {
+                                                newButton.setImage(UIImage(named: "pb_button_notification", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            } else {
+                                                newButton.setImage(UIImage(named: "pb_button_others", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
+                                            }
+                                        } else {
+                                            DispatchQueue.global().async {
+                                                let data = try? Data(contentsOf: URL(string: "https://newuniverse.io/get_file?account=\(Nexilis.sAPIKey)&image=\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
+                                                DispatchQueue.main.async {
+                                                    if data != nil {
+                                                        newButton.setImage(UIImage(data: data!), for: .normal)
+                                                    }
                                                 }
                                             }
                                         }

+ 48 - 9
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -82,6 +82,31 @@ public class Nexilis: NSObject {
     public static let OFFLINE = -3
     public static let BUSY = -4
     
+    public static let IDX_QUEUE_SYSTEM = 2
+    public static let IDX_NOTIF_CENTER = 3
+    public static let IDX_CC_STREAM = 4
+    public static let IDX_CHAT = 6
+    public static let IDX_CALL = 7
+    public static let IDX_STREAM = 8
+    public static let IDX_CC = 9
+    public static let IDX_CALL_AUDIO = 11
+    public static let IDX_CALL_VIDEO = 12
+    public static let IDX_WHITEBOARD = 13
+    public static let IDX_SCREENSHARING = 14
+    public static let IDX_WB_SS = 15
+    public static let IDX_BROADCAST_FORM = 16
+    public static let IDX_CONVERSATION = 17
+    public static let IDX_FAVORITEMESSAGE = 18
+    public static let IDX_CONFERENCE_ROOM_FORM = 19
+    public static let IDX_EMAIL_CONFIGURATION = 20
+    public static let IDX_CREATE_GROUP = 21
+    public static let IDX_ADDFRIEND = 22
+    public static let IDX_SIGNUP_OR_IN_PAGE = 23
+    public static let IDX_POST = 99
+    public static let IDX_SELF_ACT = 100
+    public static let IDX_SOCIAL_COMMERCE = 101
+    public static let IDX_NEWS = 102
+    
     private func createDelegate() {
         //print("createDelegate...")
         callDelegate = self
@@ -670,20 +695,34 @@ public class Nexilis: NSObject {
 
     public static func buttonClicked(index: Int, id: String = "") {
         //print("BTNCLICK \(index) \(id)")
-        if index == 2 {
-            Nexilis.openUrl(url: id)
-        } else if index == 3 {
+        if index == IDX_QUEUE_SYSTEM || index == IDX_NEWS || index == IDX_SOCIAL_COMMERCE {
+            openUrl(url: id)
+        } else if index == IDX_NOTIF_CENTER {
             APIS.openNotificationCenter()
-        } else if index == 6 {
-            APIS.startConversation()
-        } else if index == 7 {
+        } else if index == IDX_CHAT {
+            APIS.openChat()
+        } else if index == IDX_CALL {
             APIS.openCall()
-        } else if index == 8 {
+        } else if index == IDX_STREAM {
             APIS.openStreaming()
-        } else if index == 9 {
+        } else if index == IDX_CC {
             APIS.openContactCenter()
+        } else if index == IDX_ADDFRIEND {
+            APIS.openAddFriend()
+        } else if index == IDX_WB_SS {
+            APIS.openWhiteboardAndScreenSharing()
+        } else if index == IDX_WHITEBOARD {
+            APIS.openWhiteboard()
+        } else if index == IDX_SCREENSHARING {
+            APIS.openWhiteboardAndScreenSharing()
+        } else if index == IDX_POST {
+            
+        } else if index == IDX_CONVERSATION {
+            APIS.startConversation()
+        } else if index == IDX_FAVORITEMESSAGE {
+            APIS.openFavoriteMessage()
         } else {
-            Nexilis.openApp(id: id)
+            openApp(id: id)
         }
     }
     

+ 3 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -4043,7 +4043,9 @@ extension EditorGroup: UITableViewDelegate, UITableViewDataSource {
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)

+ 3 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -5428,7 +5428,9 @@ extension EditorPersonal: UITableViewDelegate, UITableViewDataSource {
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)

+ 3 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorStarMessages.swift

@@ -800,7 +800,9 @@ public class EditorStarMessages: UIViewController, UITableViewDataSource, UITabl
                                 ], replace: true)
                                 dataURL = json
                                 showLink()
-                                tableView.reloadRows(at: [indexPath], with: .none)
+                                DispatchQueue.main.async {
+                                    tableView.reloadRows(at: [indexPath], with: .none)
+                                }
                             } catch {
                                 rollback.pointee = true
                                 //print(error)