Explorar o código

update FB support gif

alqindiirsyam hai 1 ano
pai
achega
fb9a849fa9

+ 5 - 1
appbuilder-ios/AppBuilder/AppBuilder/FirstTabViewController.swift

@@ -110,7 +110,11 @@ class FirstTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
                     myURL = URL(string: address)
                 }
                 else {
-                    address = "https://\(ViewController.sURL)"
+                    if ViewController.sURL.contains("nexilis/pages"){
+                        address = "\(PrefsUtil.getURLBase())\(ViewController.sURL)?f_pin=\(me ?? "")&lang=\(intLang)"
+                    } else {
+                        address = "https://\(ViewController.sURL)"
+                    }
                     myURL = URL(string: address)
                 }
             }

+ 6 - 2
appbuilder-ios/AppBuilder/AppBuilder/ThirdTabViewController.swift

@@ -116,12 +116,16 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
                     myURL = URL(string: address)
                 }
                 else {
-                    address = "https://\(ViewController.tab3)"
+                    if ViewController.sURL.contains("nexilis/pages"){
+                        address = "\(PrefsUtil.getURLBase())\(ViewController.tab3)?f_pin=\(me ?? "")&lang=\(intLang)"
+                    } else {
+                        address = "https://\(ViewController.tab3)"
+                    }
                     myURL = URL(string: address)
                 }
             }
         }
-        print(address)
+        //print(address)
         if let u = myURL{
             self.webView.evaluateJavaScript("{window.localStorage.setItem('currentTab','\(ViewController.tab3)')}")
             if ((dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60) && ThirdTabViewController.atFirstPage) || ThirdTabViewController.forceRefresh {

+ 4 - 1
appbuilder-ios/AppBuilder/AppBuilder/ViewController.swift

@@ -105,6 +105,9 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                             if let enable_privacy_policy = j["app_builder_enable_privacy_policy"] as? String {
                                 PrefsUtil.setEnablePrivacyPolicy(value: enable_privacy_policy == "1" ? true : false)
                             }
+                            if let fb_icon_center_anim = j["fb_icon_center_anim"] as? String {
+                                Utils.setIconCenterAnim(value: fb_icon_center_anim)
+                            }
                         }
                         startView()
                     }
@@ -709,7 +712,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
     func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
         let js = "(function() { document.body.style.background='transparent'; })();"
         privacyWV.evaluateJavaScript(js) { (_, error) in
-            print(error as Any)
+            //print(error as Any)
         }
     }
     

+ 2 - 2
appbuilder-ios/NexilisLite/NexilisLite/Source/APIS.swift

@@ -691,9 +691,9 @@ public class APIS: NSObject {
         if UIApplication.shared.canOpenURL(url! as URL) {
             UIApplication.shared.open(url! as URL, options: [:]) { (success) in
                 if success {
-                    print("WhatsApp accessed successfully")
+                    //print("WhatsApp accessed successfully")
                 } else {
-                    print("Error accessing WhatsApp")
+                    //print("Error accessing WhatsApp")
                 }
             }
         }

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

@@ -967,7 +967,6 @@ extension Bundle {
 
         guard let resourceBundleURL = frameworkBundle.url(forResource: "NexilisLiteResources", withExtension: "bundle"),
               let resourceBundle = Bundle(url: resourceBundleURL) else {
-            //print("\(moduleName).bundle not found in \(frameworkBundle)")
             return frameworkBundle
         }
 

+ 23 - 8
appbuilder-ios/NexilisLite/NexilisLite/Source/FloatingButton/FloatingButton.swift

@@ -61,9 +61,24 @@ public class FloatingButton: UIView {
         nexilis_button.translatesAutoresizingMaskIntoConstraints = false
         nexilis_button.isUserInteractionEnabled = true
         if Utils.getIconDock() != nil {
-            let dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
-            if dataImage != nil {
-                nexilis_button.image = UIImage(data: dataImage!)
+            var dataImage: Data?
+            if Utils.getIconDock()!.contains(".gif"){
+                nexilis_button.sd_setImage(with: URL(string: Utils.getIconCenterAnim()!)) { [self] (image, error, cacheType, imageURL) in
+                    if let error = error {
+                        //print("Error loading GIF: \(error.localizedDescription)")
+                    } else {
+                        // Configure the animation
+                        nexilis_button.animationImages = image?.images
+                        nexilis_button.animationDuration = image?.duration ?? 0.0
+                        nexilis_button.animationRepeatCount = 0
+                        nexilis_button.startAnimating()
+                    }
+                }
+            } else {
+                dataImage = try? Data(contentsOf: URL(string: Utils.getUrlDock()!)!)
+                if dataImage != nil {
+                    nexilis_button.image = UIImage(data: dataImage!)
+                }
             }
         } else {
             nexilis_button.image = UIImage(named: "pb_button", in: Bundle.resourceBundle(for: Nexilis.self), with: nil)
@@ -85,11 +100,11 @@ public class FloatingButton: UIView {
         
         scrollView = UIScrollView()
         scrollView.translatesAutoresizingMaskIntoConstraints = false
-        scrollView.layer.borderWidth = 1.0
-        scrollView.layer.borderColor = UIColor.white.cgColor
-        scrollView.layer.cornerRadius = 8.0
-        scrollView.layer.masksToBounds = true
-        scrollView.backgroundColor = .black.withAlphaComponent(0.25)
+//        scrollView.layer.borderWidth = 1.0
+//        scrollView.layer.borderColor = UIColor.white.cgColor
+//        scrollView.layer.cornerRadius = 8.0
+//        scrollView.layer.masksToBounds = true
+//        scrollView.backgroundColor = .black.withAlphaComponent(0.25)
         addSubview(scrollView)
         
         scrollView.widthAnchor.constraint(equalTo: widthAnchor).isActive = true

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

@@ -228,7 +228,7 @@ public class Network {
         }, to: endUrl)
         .responseJSON { result in
             if let successResponse = result.value as? [String:Any] {
-                print("Response success")
+                //print("Response success")
                 for url in filesIn {
                     Nexilis.removeUploadFile(forKey: url.lastPathComponent)
                 }
@@ -237,12 +237,12 @@ public class Network {
             }
             else {
                 let statusCode = result.response?.statusCode
-                print("Response fail: \(statusCode)")
+                //print("Response fail: \(statusCode)")
                 completion(false,0,nil)
             }
         }
         .uploadProgress { progress in
-            print("Response progress: \(progress.fractionCompleted*100)")
+            //print("Response progress: \(progress.fractionCompleted*100)")
             let frac = progress.fractionCompleted*100
             if frac != 100.0 {
                 completion(!progress.isCancelled,frac,nil)

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

@@ -54,6 +54,14 @@ public final class Utils {
         UserDefaults.standard.set(value, forKey: "is_change_profile")
     }
     
+    public static func setIconCenterAnim(value: String){
+        UserDefaults.standard.set(value, forKey: "fb_icon_center_anim")
+    }
+    
+    public static func getIconCenterAnim() -> String? {
+        UserDefaults.standard.string(forKey: "fb_icon_center_anim")
+    }
+    
     public static func sGetCurrentDateTime(sFormat: String!) -> String! {
         let todaysDate = NSDate()
         let dateFormatter = DateFormatter()
@@ -125,7 +133,7 @@ public final class Utils {
     }
     
     static func getURLBase() -> String? {
-        return UserDefaults.standard.string(forKey: "app_builder_url_base")
+        return UserDefaults.standard.string(forKey: "app_builder_url_base") ?? "https://newuniverse.io/"
     }
     
     static func getIconDock() -> String? {