마케팅 정보를 업데이트를 앱을 실행할 때 한번만 실행하도록 수정
로그인/회원가입 시 마케팅 정보를 업데이트 하도록 수정
This commit is contained in:
@@ -12,6 +12,7 @@ class AppState: ObservableObject {
|
||||
|
||||
private var appStepBackStack = [AppStep]()
|
||||
|
||||
@Published var alreadyUpdatedMarketingInfo = false
|
||||
@Published private(set) var appStep: AppStep = .splash
|
||||
|
||||
@Published var isShowPlayer = false {
|
||||
|
@@ -15,7 +15,7 @@ final class AppViewModel: ObservableObject {
|
||||
private let userRepository = UserRepository()
|
||||
|
||||
func fetchAndUpdateIdfa() {
|
||||
DEBUG_LOG("fetchAndUpdateIdfa")
|
||||
AppState.shared.alreadyUpdatedMarketingInfo = true
|
||||
ATTrackingManager.requestTrackingAuthorization { [unowned self] status in
|
||||
if status == .authorized {
|
||||
if !UserDefaults.string(forKey: UserDefaultsKey.token).trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
|
@@ -25,10 +25,12 @@ struct SodaLiveApp: App {
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
|
||||
UIApplication.shared.applicationIconBadgeNumber = 0
|
||||
|
||||
AppsFlyerLib.shared().start()
|
||||
viewModel.fetchAndUpdateIdfa()
|
||||
viewModel.getMemberInfo()
|
||||
|
||||
if !AppState.shared.alreadyUpdatedMarketingInfo {
|
||||
viewModel.fetchAndUpdateIdfa()
|
||||
viewModel.getMemberInfo()
|
||||
}
|
||||
}
|
||||
.onOpenURL { url in
|
||||
DEBUG_LOG("I have received a URL through a custom scheme! \(url.absoluteString)")
|
||||
|
Reference in New Issue
Block a user