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面
|
///跳转A面
|
||||||
func switch_aSide() {
|
func switch_aSide() {
|
||||||
guard showStatus != false else {
|
guard showStatus == nil else {
|
||||||
//用户已经跳转过了,不要改动
|
//用户已经跳转过了,不要改动
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,15 +197,26 @@ class MP_LunchViewController: UIViewController {
|
|||||||
guard let self = self else {return}
|
guard let self = self else {return}
|
||||||
//停止计时器
|
//停止计时器
|
||||||
timer.isPaused = true
|
timer.isPaused = true
|
||||||
if accessAppdelegate.showStatus == false {
|
//判断广告是否展示
|
||||||
//当前已处于A面
|
if MP_ADSimpleManager.shared.getInterstitialSwitch() {
|
||||||
MP_AnalyticsManager.shared.jump_eventAction("A jump to B", reason: "Switch test passed, IP test passed, User delays in processing network permissions")
|
//展示中,切换完成任务块
|
||||||
|
self.completionBlock = {
|
||||||
|
MP_AnalyticsManager.shared.jump_eventAction("jump to B", reason: "Switch test passed, IP test passed")
|
||||||
|
//加载完毕,判断并跳转
|
||||||
|
accessAppdelegate.switch_positive()
|
||||||
|
}
|
||||||
}else {
|
}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 {
|
}else {
|
||||||
|
|||||||
@ -129,7 +129,7 @@ class MP_AnalyticsManager: NSObject {
|
|||||||
//每次启动都要获取值
|
//每次启动都要获取值
|
||||||
let settings = RemoteConfigSettings()
|
let settings = RemoteConfigSettings()
|
||||||
settings.minimumFetchInterval = 0
|
settings.minimumFetchInterval = 0
|
||||||
settings.fetchTimeout = 20
|
settings.fetchTimeout = 15
|
||||||
remoteConfig.configSettings = settings
|
remoteConfig.configSettings = settings
|
||||||
remoteConfig.fetch(completionHandler: {[weak self] status, error in
|
remoteConfig.fetch(completionHandler: {[weak self] status, error in
|
||||||
guard let self = self else {return}
|
guard let self = self else {return}
|
||||||
@ -285,6 +285,12 @@ class MP_AnalyticsManager: NSObject {
|
|||||||
//不存在,直接进入A面
|
//不存在,直接进入A面
|
||||||
completion(false)
|
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接口
|
//MARK: - API接口
|
||||||
///IP获取
|
///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"
|
private let header:String = "https://music.youtube.com"
|
||||||
///端点
|
///端点
|
||||||
@ -354,10 +354,10 @@ extension MP_NetWorkManager {
|
|||||||
guard let self = self else {return}
|
guard let self = self else {return}
|
||||||
switch response.result {
|
switch response.result {
|
||||||
case .success(let value):
|
case .success(let value):
|
||||||
guard let data = value.data, let code = data.isoCode else {
|
guard let code = value.country else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let ip = data.ip
|
let ip = value.ip
|
||||||
UserDefaults.standard.set(ip, forKey: "IP_Info")
|
UserDefaults.standard.set(ip, forKey: "IP_Info")
|
||||||
if ISOs.contains(code) {
|
if ISOs.contains(code) {
|
||||||
locaton = code
|
locaton = code
|
||||||
|
|||||||
@ -4,32 +4,16 @@ import Foundation
|
|||||||
|
|
||||||
///IP信息结构
|
///IP信息结构
|
||||||
struct JsonIPInfo: Codable {
|
struct JsonIPInfo: Codable {
|
||||||
let data:Datas?
|
let ip:String?
|
||||||
let message:String?
|
let country:String?
|
||||||
let status:String?
|
|
||||||
enum CodingKeys: String, CodingKey {
|
enum CodingKeys: String, CodingKey {
|
||||||
case data = "data"
|
case ip = "ip"
|
||||||
case message = "message"
|
case country = "country"
|
||||||
case status = "status"
|
|
||||||
}
|
}
|
||||||
init(from decoder: Decoder) throws {
|
init(from decoder: Decoder) throws {
|
||||||
let values = try decoder.container(keyedBy: CodingKeys.self)
|
let values = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
data = try values.decodeIfPresent(Datas.self, forKey: .data)
|
ip = try values.decodeIfPresent(String.self, forKey: .ip)
|
||||||
message = try values.decodeIfPresent(String.self, forKey: .message)
|
country = try values.decodeIfPresent(String.self, forKey: .country)
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user