Commit fa184468 by Demid Merzlyakov

IOS-107: Show ATT Prompt config attribute.

parent 185adcd9
......@@ -6,6 +6,8 @@
<string>[{&quot;lat&quot;:&quot;40.7127&quot;,&quot;lon&quot;:&quot;-74.006&quot;,&quot;city&quot;:&quot;New York&quot;,&quot;state&quot;:&quot;New York&quot;,&quot;stateCode&quot;:&quot;NY&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:1},{&quot;lat&quot;:&quot;41.8756&quot;,&quot;lon&quot;:&quot;-87.6244&quot;,&quot;city&quot;:&quot;Chicago&quot;,&quot;state&quot;:&quot;Illinois&quot;,&quot;stateCode&quot;:&quot;IL&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:2},{&quot;lat&quot;:&quot;29.7589&quot;,&quot;lon&quot;:&quot;-95.3677&quot;,&quot;city&quot;:&quot;Houston&quot;,&quot;state&quot;:&quot;Texas&quot;,&quot;stateCode&quot;:&quot;TX&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:3},{&quot;lat&quot;:&quot;34.0537&quot;,&quot;lon&quot;:&quot;-118.243&quot;,&quot;city&quot;:&quot;Los Angeles&quot;,&quot;state&quot;:&quot;California&quot;,&quot;stateCode&quot;:&quot;CA&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:4},{&quot;lat&quot;:&quot;29.4246&quot;,&quot;lon&quot;:&quot;-98.4951&quot;,&quot;city&quot;:&quot;San Antonio&quot;,&quot;state&quot;:&quot;Texas&quot;,&quot;stateCode&quot;:&quot;TX&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:5},{&quot;lat&quot;:&quot;39.7683&quot;,&quot;lon&quot;:&quot;-86.1584&quot;,&quot;city&quot;:&quot;Indianapolis&quot;,&quot;state&quot;:&quot;Indiana&quot;,&quot;stateCode&quot;:&quot;IN&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:6},{&quot;lat&quot;:&quot;39.9527&quot;,&quot;lon&quot;:&quot;-75.1635&quot;,&quot;city&quot;:&quot;Philadelphia&quot;,&quot;state&quot;:&quot;Pennsylvania&quot;,&quot;stateCode&quot;:&quot;PA&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:7},{&quot;lat&quot;:&quot;36.1673&quot;,&quot;lon&quot;:&quot;-115.149&quot;,&quot;city&quot;:&quot;Las Vegas&quot;,&quot;state&quot;:&quot;Nevada&quot;,&quot;stateCode&quot;:&quot;NV&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:8},{&quot;lat&quot;:&quot;39.9623&quot;,&quot;lon&quot;:&quot;-83.0007&quot;,&quot;city&quot;:&quot;Columbus&quot;,&quot;state&quot;:&quot;Ohio&quot;,&quot;stateCode&quot;:&quot;OH&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:9},{&quot;lat&quot;:&quot;30.3322&quot;,&quot;lon&quot;:&quot;-81.6557&quot;,&quot;city&quot;:&quot;Jacksonville&quot;,&quot;state&quot;:&quot;Florida&quot;,&quot;stateCode&quot;:&quot;FL&quot;,&quot;country&quot;:&quot;United States of America&quot;,&quot;countryCode&quot;:&quot;US&quot;,&quot;order&quot;:10}]</string>
<key>ios_nws_alerts_via_moengage_enabled</key>
<true/>
<key>ios_show_att_prompt</key>
<false/>
<key>ads_config_ios</key>
<string>{
&quot;//&quot;: &quot;1Weather iOS built in config. Override it in the Firebase console. Note that the ads_enabled: true is needed for correct initialization after receiving a proper config.&quot;,
......
......@@ -17,12 +17,14 @@ public struct AppConfig: Codable {
public let adConfig: AdConfig
public let ccpaUpdateInterval: TimeInterval?
public let nwsAlertsViaMoEngageEnabled: Bool
public let showAttPrompt: Bool
public init(popularCities: [GeoNamesPlace]?, adConfig: AdConfig, ccpaUpdateInterval: TimeInterval?, nwsAlertsViaMoEngageEnabled: Bool) {
public init(popularCities: [GeoNamesPlace]?, adConfig: AdConfig, ccpaUpdateInterval: TimeInterval?, nwsAlertsViaMoEngageEnabled: Bool, showAttPrompt: Bool) {
self.popularCities = popularCities
self.adConfig = adConfig
self.ccpaUpdateInterval = ccpaUpdateInterval
self.nwsAlertsViaMoEngageEnabled = nwsAlertsViaMoEngageEnabled
self.showAttPrompt = showAttPrompt
}
}
......@@ -35,6 +37,7 @@ public class ConfigManager {
private static let popularCitiesConfigKey = "search_screen_popular_cities"
private static let ccpaUpdateIntervalConfigKey = "ccpa_update_interval_ios"
private static let nwsAlertsViaMoEngageEnabledKey = "ios_nws_alerts_via_moengage_enabled"
private static let showAttPromptKey = "ios_show_att_prompt"
private let delegates = MulticastDelegate<ConfigManagerDelegate>()
......@@ -50,7 +53,7 @@ public class ConfigManager {
public static let shared = ConfigManager()
public var config: AppConfig = AppConfig(popularCities: nil, adConfig: AdConfig(), ccpaUpdateInterval: nil, nwsAlertsViaMoEngageEnabled: true)
public var config: AppConfig = AppConfig(popularCities: nil, adConfig: AdConfig(), ccpaUpdateInterval: nil, nwsAlertsViaMoEngageEnabled: true, showAttPrompt: false)
public func updateConfig() {
log.info("update config")
......@@ -122,9 +125,11 @@ public class ConfigManager {
let nwsAlertsViaMoEngageEnabledValue = remoteConfig.configValue(forKey: ConfigManager.nwsAlertsViaMoEngageEnabledKey)
let nwsAlertsViaMoEngageEnabled = nwsAlertsViaMoEngageEnabledValue.boolValue
let showAttPromptValue = remoteConfig.configValue(forKey: ConfigManager.showAttPromptKey)
let showAttPrompt = showAttPromptValue.boolValue
DispatchQueue.main.async {
self.config = AppConfig(popularCities: popularCities, adConfig: adConfig, ccpaUpdateInterval: ccpaUpdateInterval, nwsAlertsViaMoEngageEnabled: nwsAlertsViaMoEngageEnabled)
self.config = AppConfig(popularCities: popularCities, adConfig: adConfig, ccpaUpdateInterval: ccpaUpdateInterval, nwsAlertsViaMoEngageEnabled: nwsAlertsViaMoEngageEnabled, showAttPrompt: showAttPrompt)
self.notifyAboutConfigUpdate()
DispatchQueue.global().async {
let encoder = JSONEncoder()
......@@ -135,7 +140,6 @@ public class ConfigManager {
else {
self.log.warning("New config: failed to encode to JSON.")
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment