|
@@ -154,6 +154,14 @@ public final class Utils {
|
|
UserDefaults.standard.string(forKey: "fb_config_mode") ?? "1"
|
|
UserDefaults.standard.string(forKey: "fb_config_mode") ?? "1"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ static func setCookiesMobile(value: String) {
|
|
|
|
+ UserDefaults.standard.set(value, forKey: "cookies_mobile")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ static func getCookiesMobile() -> String {
|
|
|
|
+ UserDefaults.standard.string(forKey: "cookies_mobile") ?? ""
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public static func sGetCurrentDateTime(sFormat: String!) -> String! {
|
|
public static func sGetCurrentDateTime(sFormat: String!) -> String! {
|
|
let todaysDate = NSDate()
|
|
let todaysDate = NSDate()
|
|
@@ -307,9 +315,11 @@ public final class Utils {
|
|
request.setValue(Utils.getUserAgent(), forHTTPHeaderField: "User-Agent")
|
|
request.setValue(Utils.getUserAgent(), forHTTPHeaderField: "User-Agent")
|
|
let cookies = HTTPCookieStorage.shared.cookies ?? []
|
|
let cookies = HTTPCookieStorage.shared.cookies ?? []
|
|
if let cookieHeader = HTTPCookie.requestHeaderFields(with: cookies)["Cookie"] {
|
|
if let cookieHeader = HTTPCookie.requestHeaderFields(with: cookies)["Cookie"] {
|
|
-// print("listCookiee: \(cookieHeader)")
|
|
|
|
- request.setValue(cookieHeader, forHTTPHeaderField: "Cookie")
|
|
|
|
|
|
+// print("listCookiee: \(cookieHeader)")
|
|
|
|
+ request.setValue(cookieHeader, forHTTPHeaderField: "Cookie")
|
|
}
|
|
}
|
|
|
|
+// request.setValue(Utils.getCookiesMobile(), forHTTPHeaderField: "Cookie")
|
|
|
|
+// print("DATA SEND MOBILE \(Utils.getUserAgent()) <> \(Utils.getCookiesMobile())")
|
|
let task = URLSession.shared.dataTask(with: request, completionHandler: completion)
|
|
let task = URLSession.shared.dataTask(with: request, completionHandler: completion)
|
|
task.resume()
|
|
task.resume()
|
|
}
|
|
}
|