Marino Faggiana 6 жил өмнө
parent
commit
449d667c29

+ 1 - 1
iOSClient/Brand/Intro/CCIntro.m

@@ -237,7 +237,7 @@
 {
     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
-    SwiftModalWebVC *webVC = [[SwiftModalWebVC alloc] initWithUrlString:[NCBrandOptions sharedInstance].linkLoginHost colorText:[UIColor whiteColor] colorDoneButton:[UIColor blackColor] doneButtonVisible:YES hideToolbar:NO useRedirectCookieHandling:false];
+    SwiftModalWebVC *webVC = [[SwiftModalWebVC alloc] initWithUrlString:[NCBrandOptions sharedInstance].linkLoginHost colorText:[UIColor whiteColor] colorDoneButton:[UIColor blackColor] doneButtonVisible:YES hideToolbar:NO];
     webVC.delegateWeb = self;
     
     [appDelegate.window.rootViewController presentViewController:webVC animated:YES completion:nil];

+ 4 - 4
iOSClient/Library/SwiftWebVC/SwiftModalWebVC.swift

@@ -21,14 +21,14 @@ public class SwiftModalWebVC: UINavigationController {
     
     weak var webViewDelegate: UIWebViewDelegate? = nil
     
-    @objc public convenience init(urlString: String, colorText: UIColor, colorDoneButton: UIColor, doneButtonVisible: Bool, hideToolbar: Bool = false, useRedirectCookieHandling:Bool) {
+    @objc public convenience init(urlString: String, colorText: UIColor, colorDoneButton: UIColor, doneButtonVisible: Bool, hideToolbar: Bool = false) {
         let url = URL(string: urlString)!
-        self.init(request: URLRequest(url: url), colorText: colorText, colorDoneButton: colorDoneButton, doneButtonVisible: doneButtonVisible, hideToolbar: hideToolbar, useRedirectCookieHandling: useRedirectCookieHandling)
+        self.init(request: URLRequest(url: url), colorText: colorText, colorDoneButton: colorDoneButton, doneButtonVisible: doneButtonVisible, hideToolbar: hideToolbar)
     }
     
-    public init(request: URLRequest, colorText: UIColor = UIColor.white, colorDoneButton: UIColor = UIColor.black, doneButtonVisible: Bool = false, hideToolbar: Bool = false, useRedirectCookieHandling: Bool) {
+    public init(request: URLRequest, colorText: UIColor = UIColor.white, colorDoneButton: UIColor = UIColor.black, doneButtonVisible: Bool = false, hideToolbar: Bool = false) {
         
-        let webViewController = SwiftWebVC(aRequest: request, hideToolbar: hideToolbar, useRedirectCookieHandling: useRedirectCookieHandling)
+        let webViewController = SwiftWebVC(aRequest: request, hideToolbar: hideToolbar)
         webViewController.storedStatusColor = UINavigationBar.appearance().barStyle
         
         super.init(rootViewController: webViewController)

+ 6 - 8
iOSClient/Library/SwiftWebVC/SwiftWebVC.swift

@@ -23,7 +23,6 @@ public class SwiftWebVC: UIViewController {
     var buttonColor: UIColor? = nil
     var titleColor: UIColor? = nil
     var closing: Bool! = false
-    var useRedirectCookieHandling: Bool = false
     
     lazy var backBarButtonItem: UIBarButtonItem =  {
         var tempBackBarButtonItem = UIBarButtonItem(image: SwiftWebVC.bundledImage(named: "SwiftWebVCBack"),
@@ -71,7 +70,7 @@ public class SwiftWebVC: UIViewController {
     
     
     lazy var webView: WKCookieWebView = {
-        var tempWebView = WKCookieWebView(frame: UIScreen.main.bounds, configuration: WKWebViewConfiguration(), useRedirectCookieHandling: useRedirectCookieHandling)
+        var tempWebView = WKCookieWebView(frame: UIScreen.main.bounds, configuration: WKWebViewConfiguration(), useRedirectCookieHandling: true)
         tempWebView.uiDelegate = self
         tempWebView.navigationDelegate = self
         return tempWebView;
@@ -92,17 +91,16 @@ public class SwiftWebVC: UIViewController {
         webView.navigationDelegate = nil;
     }
     
-    public convenience init(urlString: String, hideToolbar: Bool, useRedirectCookieHandling: Bool) {
-        self.init(pageURL: URL(string: urlString)!, hideToolbar: hideToolbar, useRedirectCookieHandling: useRedirectCookieHandling)
+    public convenience init(urlString: String, hideToolbar: Bool) {
+        self.init(pageURL: URL(string: urlString)!, hideToolbar: hideToolbar)
     }
     
-    public convenience init(pageURL: URL, hideToolbar: Bool, useRedirectCookieHandling: Bool) {
-        self.init(aRequest: URLRequest(url: pageURL), hideToolbar: hideToolbar, useRedirectCookieHandling: useRedirectCookieHandling)
+    public convenience init(pageURL: URL, hideToolbar: Bool) {
+        self.init(aRequest: URLRequest(url: pageURL), hideToolbar: hideToolbar)
     }
     
-    public convenience init(aRequest: URLRequest, hideToolbar: Bool, useRedirectCookieHandling: Bool) {
+    public convenience init(aRequest: URLRequest, hideToolbar: Bool) {
         self.init()
-        self.useRedirectCookieHandling = useRedirectCookieHandling
         self.request = aRequest
         self.hideToolbar = hideToolbar
     }

+ 1 - 1
iOSClient/Login/CCLoginWeb.swift

@@ -52,7 +52,7 @@ public class CCLoginWeb: UIViewController {
             urlString =  urlBase+k_flowEndpoint
         }
         
-        let webVC = SwiftModalWebVC(urlString: urlString, colorText: UIColor.black, colorDoneButton: UIColor.black, doneButtonVisible: doneButtonVisible, hideToolbar: true, useRedirectCookieHandling: true)
+        let webVC = SwiftModalWebVC(urlString: urlString, colorText: UIColor.black, colorDoneButton: UIColor.black, doneButtonVisible: doneButtonVisible, hideToolbar: true)
         webVC.delegateWeb = self
 
         vc.present(webVC, animated: false, completion: nil)

+ 4 - 4
iOSClient/Main/CCMore.swift

@@ -408,14 +408,14 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
             
             if (self.splitViewController?.isCollapsed)! {
                 
-                let webVC = SwiftWebVC(urlString: item.url, hideToolbar: false, useRedirectCookieHandling: false)
+                let webVC = SwiftWebVC(urlString: item.url, hideToolbar: false)
                 webVC.delegate = self
                 self.navigationController?.pushViewController(webVC, animated: true)
                 self.navigationController?.navigationBar.isHidden = false
                 
             } else {
                 
-                let webVC = SwiftModalWebVC(urlString: item.url, colorText: UIColor.white, colorDoneButton: UIColor.black, doneButtonVisible: true, useRedirectCookieHandling: false)
+                let webVC = SwiftModalWebVC(urlString: item.url, colorText: UIColor.white, colorDoneButton: UIColor.black, doneButtonVisible: true)
                 webVC.delegateWeb = self
                 self.present(webVC, animated: true, completion: nil)
             }
@@ -450,14 +450,14 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
             
             if (self.splitViewController?.isCollapsed)! {
                 
-                let webVC = SwiftWebVC(urlString: item.url, hideToolbar: true, useRedirectCookieHandling: false)
+                let webVC = SwiftWebVC(urlString: item.url, hideToolbar: true)
                 webVC.delegate = self
                 self.navigationController?.pushViewController(webVC, animated: true)
                 self.navigationController?.navigationBar.isHidden = false
                 
             } else {
                 
-                let webVC = SwiftModalWebVC(urlString: item.url, colorText: UIColor.white, colorDoneButton: UIColor.black, doneButtonVisible: true, hideToolbar: false, useRedirectCookieHandling: false)
+                let webVC = SwiftModalWebVC(urlString: item.url, colorText: UIColor.white, colorDoneButton: UIColor.black, doneButtonVisible: true, hideToolbar: false)
                 webVC.delegateWeb = self
                 self.present(webVC, animated: true, completion: nil)
             }