1.3.1 提审版本
This commit is contained in:
parent
15922d59af
commit
1a06d6346b
Binary file not shown.
@ -154,7 +154,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
///跳转A面
|
||||
func switch_aSide() {
|
||||
guard showStatus != false else {
|
||||
guard showStatus == nil else {
|
||||
//用户已经跳转过了,不要改动
|
||||
return
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user