Commit 29265d44 by Dmitriy Stepanets

Merge branch 'develop' into modules

# Conflicts:
#	1Weather/Model/CCPA/CCPAHelper.swift
parents c264d4b4 37a45923
...@@ -24,17 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -24,17 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private let appsFlyerLog = Logger(componentName: "AppsFlyer") private let appsFlyerLog = Logger(componentName: "AppsFlyer")
private let log = Logger(componentName: "AppDelegate") private let log = Logger(componentName: "AppDelegate")
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func initializeAppsFlyer() {
ThemeManager.refreshAppearance()
// WDT radar setup
SwarmManager.sharedManager.authentication = SkywiseAuthentication(
app_id: WDT_APP_ID,
app_key: WDT_APP_KEY
)
self.window = UIWindow(frame: UIScreen.main.bounds)
appsFlyerLog.info("AppsFlyer initialize with AppsFlyerId: \(kAppsFlyerId), Apple App ID: \(kAppsFlyerAppId)") appsFlyerLog.info("AppsFlyer initialize with AppsFlyerId: \(kAppsFlyerId), Apple App ID: \(kAppsFlyerAppId)")
appsFlyer.appsFlyerDevKey = kAppsFlyerId appsFlyer.appsFlyerDevKey = kAppsFlyerId
appsFlyer.appleAppID = kAppsFlyerAppId appsFlyer.appleAppID = kAppsFlyerAppId
...@@ -45,6 +35,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -45,6 +35,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
#else #else
appsFlyer.isDebug = false appsFlyer.isDebug = false
#endif #endif
appsFlyer.start { [weak self] dictionary, error in
if let error = error {
self?.appsFlyerLog.error("AppsFlyer start error: \(error)")
}
else {
self?.appsFlyerLog.info("AppsFlyer start result: \(dictionary)")
}
}
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ThemeManager.refreshAppearance()
// WDT radar setup
SwarmManager.sharedManager.authentication = SkywiseAuthentication(
app_id: WDT_APP_ID,
app_key: WDT_APP_KEY
)
self.window = UIWindow(frame: UIScreen.main.bounds)
// Note that the Amazon SDK will get assigned a proper value for consent status inside CCPAHelper.onAppLaunch // Note that the Amazon SDK will get assigned a proper value for consent status inside CCPAHelper.onAppLaunch
// So, make sure this call happens after the // So, make sure this call happens after the
...@@ -121,14 +131,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -121,14 +131,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidBecomeActive(_ application: UIApplication) { func applicationDidBecomeActive(_ application: UIApplication) {
LocationManager.shared.updateEverythingIfNeeded() LocationManager.shared.updateEverythingIfNeeded()
appsFlyer.start { [weak self] dictionary, error in
if let error = error {
self?.appsFlyerLog.error("AppsFlyer start error: \(error)")
}
else {
self?.appsFlyerLog.info("AppsFlyer start result: \(dictionary)")
}
}
} }
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
......
...@@ -19,6 +19,7 @@ import CryptoKit ...@@ -19,6 +19,7 @@ import CryptoKit
import FBAudienceNetwork import FBAudienceNetwork
import PSMLocationSDK import PSMLocationSDK
import DTBiOSSDK import DTBiOSSDK
import AppsFlyerLib
import OneWeatherCore import OneWeatherCore
fileprivate let APP_NAME = "ONE_WEATHER" fileprivate let APP_NAME = "ONE_WEATHER"
...@@ -157,6 +158,14 @@ class CCPAHelper { ...@@ -157,6 +158,14 @@ class CCPAHelper {
// MoEngage // MoEngage
MoEngage.sharedInstance().optOut(ofDataTracking: !canCollectData) MoEngage.sharedInstance().optOut(ofDataTracking: !canCollectData)
AppsFlyerLib.shared().isStopped = !canCollectData
if canCollectData {
onMain {
let appDelegate = UIApplication.shared.delegate as? AppDelegate
appDelegate?.initializeAppsFlyer()
}
}
} }
private func registerApp(reason: String) { private func registerApp(reason: String) {
......
...@@ -90,6 +90,9 @@ public class PushNotificationsManager: NSObject { ...@@ -90,6 +90,9 @@ public class PushNotificationsManager: NSObject {
log.info("Got new APNS token: \(tokenString)") log.info("Got new APNS token: \(tokenString)")
MoEngage.sharedInstance().setPushToken(pushToken) MoEngage.sharedInstance().setPushToken(pushToken)
AppsFlyerLib.shared().registerUninstall(pushToken) AppsFlyerLib.shared().registerUninstall(pushToken)
#if DEBUG
AppsFlyerLib.shared().useUninstallSandbox = true
#endif
} }
} }
......
...@@ -170,6 +170,9 @@ class MapTimeControlView: UIView { ...@@ -170,6 +170,9 @@ class MapTimeControlView: UIView {
} }
@objc private func handleTapGesture(gestureRecoginzer:UIGestureRecognizer) { @objc private func handleTapGesture(gestureRecoginzer:UIGestureRecognizer) {
guard !currentItems.isEmpty else {
return
}
let location = gestureRecoginzer.location(in: self) let location = gestureRecoginzer.location(in: self)
let progress = max(location.x - stackView.frame.origin.x, 0) / (self.bounds.width - stackView.frame.origin.x) let progress = max(location.x - stackView.frame.origin.x, 0) / (self.bounds.width - stackView.frame.origin.x)
let targetIndex = Int(CGFloat(currentItems.count) * progress) let targetIndex = Int(CGFloat(currentItems.count) * progress)
......
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