alqindiirsyam 1 vuosi sitten
vanhempi
commit
bc7ad01ab8

+ 1 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/Download.swift

@@ -23,7 +23,7 @@ public class Download {
     
     var DOWNLOAD_BUFFER = [Data?]()
     var DOWNLOAD_SESSION = [Session]()
-    var DOWNLOAD_URL = "https://newuniverse.io/filepalio/image/"
+    var DOWNLOAD_URL = Utils.getURLBase()! + "filepalio/image/"
     
     public func start(forKey: String, delegate: DownloadDelegate){
         self.delegate = delegate

+ 1 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/Extension.swift

@@ -346,7 +346,7 @@ extension NSObject {
 extension URL {
     
     static func palioImage(named: String) -> URL? {
-        return URL(string: "https://newuniverse.io/filepalio/image/\(named)")
+        return URL(string: Utils.getURLBase()! + "filepalio/image/\(named)")
     }
     
 }

+ 9 - 25
appbuilder-ios/DigiXLite/DigiXLite/Source/FloatingButton/FloatingButton.swift

@@ -214,6 +214,7 @@ public class FloatingButton: UIView {
     private func checkDelayAnimation() {
         DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: { [self] in
             if !isShow {
+                animationTimer.invalidate()
                 animationTimer = Timer.scheduledTimer(timeInterval: 0.001, target: self, selector: #selector(runAnimation), userInfo: nil, repeats: true)
             }
         })
@@ -291,7 +292,9 @@ public class FloatingButton: UIView {
                             let data = try? Data(contentsOf: URL(string: "https://DigiX.io/dashboardv2/uploads/fb_icon/\(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 let image = UIImage(data: data!) {
+                                        newButton.setImage(image, for: .normal)
+                                    }
                                 }
                             }
                         }
@@ -546,36 +549,17 @@ public class FloatingButton: UIView {
         var app_id = sender.accessibilityIdentifier!
         var indexTap = 0
         if package_id.contains("_fb"){
-            let numIdx = package_id.split(separator: "_")[1]
+            let listSplit = package_id.split(separator: "_", maxSplits: 1)
+            let numIdx = listSplit[listSplit.firstIndex(of: "fb") ?? 0]
             indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
-        }
-        if indexTap == 2 {
-            app_id = package_id.components(separatedBy: "_")[2]
+            if listSplit.count == 2 {
+                app_id = String(listSplit[1])
+            }
         }
         DigiX.buttonClicked(index: indexTap, id: app_id)
         hideButton()
     }
     
-    @objc func fb1Tap() {
-        APIS.openContactCenter()
-        hideButton()
-    }
-    
-    @objc func fb2Tap() {
-        APIS.startConversation()
-        hideButton()
-    }
-    
-    @objc func fb3Tap() {
-        APIS.openCall()
-        hideButton()
-    }
-    
-    @objc func fb4Tap() {
-        APIS.openStreaming()
-        hideButton()
-    }
-    
     @objc func qmeraLongPress(gestureRecognizer: UILongPressGestureRecognizer) {
         if gestureRecognizer.state == .began {
             if mySettingDelegate != nil {

+ 1 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/Network.swift

@@ -17,7 +17,7 @@ public class Network {
     private var isCancel = false
     private var progress = 0.0
     private var CHUNK_SIZE = 200 * 1024
-    private var UPLOAD_URL = "https://newuniverse.io/uploader"
+    private var UPLOAD_URL = Utils.getURLBase()! + "uploader"
     
     public init() {}
     

+ 1 - 1
appbuilder-ios/DigiXLite/DigiXLite/Source/Utils.swift

@@ -123,7 +123,7 @@ public final class Utils {
     }
     
     static func getCustomButtons() -> String {
-        UserDefaults.standard.string(forKey: "app_builder_button_icon") ?? ""
+        UserDefaults.standard.string(forKey: "app_builder_custom_buttons") ?? ""
     }
     
     static func setCustomFBIcon(value: String){

+ 7 - 0
appbuilder-ios/DigiXLite/DigiXLite/Source/View/BNIView/BNIBookingWebView.swift

@@ -20,6 +20,13 @@ class BNIBookingWebView: UIViewController, WKNavigationDelegate, UIScrollViewDel
     override func viewDidLoad() {
         super.viewDidLoad()
         
+        let configuration = WKWebViewConfiguration()
+        configuration.allowsInlineMediaPlayback = true
+        let customUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1 easySoftIndonesia"
+        let finalUserAgent = "\(customUserAgent)"
+        configuration.applicationNameForUserAgent = finalUserAgent
+        webView = WKWebView(frame: .zero, configuration: configuration)
+        
         view.addSubview(webView)
         webView.translatesAutoresizingMaskIntoConstraints = false
         webView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Download.swift

@@ -23,7 +23,7 @@ public class Download {
     
     var DOWNLOAD_BUFFER = [Data?]()
     var DOWNLOAD_SESSION = [Session]()
-    var DOWNLOAD_URL = "https://newuniverse.io/filepalio/image/"
+    var DOWNLOAD_URL = Utils.getURLBase()! + "filepalio/image/"
     
     public func start(forKey: String, delegate: DownloadDelegate){
         self.delegate = delegate

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Extension.swift

@@ -346,7 +346,7 @@ extension NSObject {
 extension URL {
     
     static func palioImage(named: String) -> URL? {
-        return URL(string: "https://newuniverse.io/filepalio/image/\(named)")
+        return URL(string: Utils.getURLBase()! + "filepalio/image/\(named)")
     }
     
 }

+ 9 - 25
appbuilder-ios/NexilisLite/NexilisLite/Source/FloatingButton/FloatingButton.swift

@@ -220,6 +220,7 @@ public class FloatingButton: UIView {
     private func checkDelayAnimation() {
         DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: { [self] in
             if !isShow {
+                animationTimer.invalidate()
                 animationTimer = Timer.scheduledTimer(timeInterval: 0.001, target: self, selector: #selector(runAnimation), userInfo: nil, repeats: true)
             }
         })
@@ -297,7 +298,9 @@ public class FloatingButton: UIView {
                             let data = try? Data(contentsOf: URL(string: "https://nexilis.io/dashboardv2/uploads/fb_icon/\(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 let image = UIImage(data: data!) {
+                                        newButton.setImage(image, for: .normal)
+                                    }
                                 }
                             }
                         }
@@ -552,36 +555,17 @@ public class FloatingButton: UIView {
         var app_id = sender.accessibilityIdentifier!
         var indexTap = 0
         if package_id.contains("_fb"){
-            let numIdx = package_id.split(separator: "_")[1]
+            let listSplit = package_id.split(separator: "_", maxSplits: 1)
+            let numIdx = listSplit[listSplit.firstIndex(of: "fb") ?? 0]
             indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
-        }
-        if indexTap == 2 {
-            app_id = package_id.components(separatedBy: "_")[2]
+            if listSplit.count == 2 {
+                app_id = String(listSplit[1])
+            }
         }
         Nexilis.buttonClicked(index: indexTap, id: app_id)
         hideButton()
     }
     
-    @objc func fb1Tap() {
-        APIS.openContactCenter()
-        hideButton()
-    }
-    
-    @objc func fb2Tap() {
-        APIS.startConversation()
-        hideButton()
-    }
-    
-    @objc func fb3Tap() {
-        APIS.openCall()
-        hideButton()
-    }
-    
-    @objc func fb4Tap() {
-        APIS.openStreaming()
-        hideButton()
-    }
-    
     @objc func qmeraLongPress(gestureRecognizer: UILongPressGestureRecognizer) {
         if gestureRecognizer.state == .began {
             if mySettingDelegate != nil {

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Network.swift

@@ -17,7 +17,7 @@ public class Network {
     private var isCancel = false
     private var progress = 0.0
     private var CHUNK_SIZE = 200 * 1024
-    private var UPLOAD_URL = "https://newuniverse.io/uploader"
+    private var UPLOAD_URL = Utils.getURLBase()! + "uploader"
     
     public init() {}
     

+ 1 - 1
appbuilder-ios/NexilisLite/NexilisLite/Source/Utils.swift

@@ -123,7 +123,7 @@ public final class Utils {
     }
     
     static func getCustomButtons() -> String {
-        UserDefaults.standard.string(forKey: "app_builder_button_icon") ?? ""
+        UserDefaults.standard.string(forKey: "app_builder_custom_buttons") ?? ""
     }
     
     static func setCustomFBIcon(value: String){

+ 7 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/BNIView/BNIBookingWebView.swift

@@ -20,6 +20,13 @@ class BNIBookingWebView: UIViewController, WKNavigationDelegate, UIScrollViewDel
     override func viewDidLoad() {
         super.viewDidLoad()
         
+        let configuration = WKWebViewConfiguration()
+        configuration.allowsInlineMediaPlayback = true
+        let customUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1 easySoftIndonesia"
+        let finalUserAgent = "\(customUserAgent)"
+        configuration.applicationNameForUserAgent = finalUserAgent
+        webView = WKWebView(frame: .zero, configuration: configuration)
+        
         view.addSubview(webView)
         webView.translatesAutoresizingMaskIntoConstraints = false
         webView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true