diff --git a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate index e53b4bc..af8a063 100644 Binary files a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate and b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/relax.offline.mp3.music/AppDelegate.swift b/relax.offline.mp3.music/AppDelegate.swift index 8d5df95..1b98bec 100644 --- a/relax.offline.mp3.music/AppDelegate.swift +++ b/relax.offline.mp3.music/AppDelegate.swift @@ -154,7 +154,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } ///跳转A面 func switch_aSide() { - guard showStatus != false else { + guard showStatus == nil else { //用户已经跳转过了,不要改动 return } diff --git a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift index 36b0758..63322d5 100644 --- a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift +++ b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift @@ -197,15 +197,26 @@ class MP_LunchViewController: UIViewController { guard let self = self else {return} //停止计时器 timer.isPaused = true - if accessAppdelegate.showStatus == false { - //当前已处于A面 - MP_AnalyticsManager.shared.jump_eventAction("A jump to B", reason: "Switch test passed, IP test passed, User delays in processing network permissions") + //判断广告是否展示 + if MP_ADSimpleManager.shared.getInterstitialSwitch() { + //展示中,切换完成任务块 + self.completionBlock = { + MP_AnalyticsManager.shared.jump_eventAction("jump to B", reason: "Switch test passed, IP test passed") + //加载完毕,判断并跳转 + accessAppdelegate.switch_positive() + } }else { - //当前还未跳转 - MP_AnalyticsManager.shared.jump_eventAction("jump to B", reason: "Switch test passed, IP test passed") + //没有展示 + if accessAppdelegate.showStatus == false { + //当前已处于A面 + MP_AnalyticsManager.shared.jump_eventAction("A jump to B", reason: "Switch test passed, IP test passed, User delays in processing network permissions") + }else { + //当前还未跳转 + MP_AnalyticsManager.shared.jump_eventAction("jump to B", reason: "Switch test passed, IP test passed") + } + //加载完毕,判断并跳转 + accessAppdelegate.switch_positive() } - //加载完毕,判断并跳转 - accessAppdelegate.switch_positive() } } }else { diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift index db330bf..92b223f 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_AnalyticsManager.swift @@ -129,7 +129,7 @@ class MP_AnalyticsManager: NSObject { //每次启动都要获取值 let settings = RemoteConfigSettings() settings.minimumFetchInterval = 0 - settings.fetchTimeout = 20 + settings.fetchTimeout = 15 remoteConfig.configSettings = settings remoteConfig.fetch(completionHandler: {[weak self] status, error in guard let self = self else {return} @@ -285,6 +285,12 @@ class MP_AnalyticsManager: NSObject { //不存在,直接进入A面 completion(false) } + if frequency > 0 { + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + print("重启firebase请求") + self.getOpenStatus(frequency - 1, completion: completion) + } + } } }) } diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift index 864b545..ad9226d 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift @@ -73,7 +73,7 @@ class MP_NetWorkManager: NSObject { //MARK: - API接口 ///IP获取 - private let iPInfo:String = "https://api.tikustok.com/app/common/getIPInfo" + private let iPInfo:String = "https://ipinfo.io/json" ///域名链接 private let header:String = "https://music.youtube.com" ///端点 @@ -354,10 +354,10 @@ extension MP_NetWorkManager { guard let self = self else {return} switch response.result { case .success(let value): - guard let data = value.data, let code = data.isoCode else { + guard let code = value.country else { return } - let ip = data.ip + let ip = value.ip UserDefaults.standard.set(ip, forKey: "IP_Info") if ISOs.contains(code) { locaton = code diff --git a/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonBrowse.swift b/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonBrowse.swift index d7b98b7..a672829 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonBrowse.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonBrowse.swift @@ -4,32 +4,16 @@ import Foundation ///IP信息结构 struct JsonIPInfo: Codable { - let data:Datas? - let message:String? - let status:String? + let ip:String? + let country:String? enum CodingKeys: String, CodingKey { - case data = "data" - case message = "message" - case status = "status" + case ip = "ip" + case country = "country" } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) - data = try values.decodeIfPresent(Datas.self, forKey: .data) - message = try values.decodeIfPresent(String.self, forKey: .message) - status = try values.decodeIfPresent(String.self, forKey: .status) - } - struct Datas: Codable { - let isoCode:String? - let ip:String? - enum CodingKeys: String, CodingKey { - case isoCode = "isoCode" - case ip = "ip" - } - init(from decoder: Decoder) throws { - let values = try decoder.container(keyedBy: CodingKeys.self) - isoCode = try values.decodeIfPresent(String.self, forKey: .isoCode) - ip = try values.decodeIfPresent(String.self, forKey: .ip) - } + ip = try values.decodeIfPresent(String.self, forKey: .ip) + country = try values.decodeIfPresent(String.self, forKey: .country) } }