From 040efe1cdaaf114b7e7e1ebe88ccfa14812767b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=96=E5=8C=97=E7=A7=A6=E4=B9=9D?= Date: Sat, 24 Jan 2026 10:14:16 +0800 Subject: [PATCH] =?UTF-8?q?idfa=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fableon.xcodeproj/project.pbxproj | 4 ++-- Fableon/App/SceneDelegate.swift | 10 +++++----- .../Object/Base/Controller/FATabBarController.swift | 1 - Fableon/Object/Libs/FATool/FATool.swift | 8 ++++++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Fableon.xcodeproj/project.pbxproj b/Fableon.xcodeproj/project.pbxproj index 754806a..503f384 100644 --- a/Fableon.xcodeproj/project.pbxproj +++ b/Fableon.xcodeproj/project.pbxproj @@ -2792,7 +2792,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 6XALB8RSYF; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GENERATE_INFOPLIST_FILE = YES; @@ -2835,7 +2835,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 6XALB8RSYF; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Fableon/Source/Info.plist; diff --git a/Fableon/App/SceneDelegate.swift b/Fableon/App/SceneDelegate.swift index c546579..cdd6702 100644 --- a/Fableon/App/SceneDelegate.swift +++ b/Fableon/App/SceneDelegate.swift @@ -47,6 +47,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { } func sceneDidBecomeActive(_ scene: UIScene) { + FATool.requestIDFAAuthorization(nil) self.handleOnLine() FAStatAPI.requestEnterApp() self.setBadgeCount(0) @@ -76,13 +77,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { extension SceneDelegate { private func startApp() { - setRootVC() let languageManager = FALanguageManager.manager if languageManager.languageDataLanguageKey != languageManager.currentLanguageKey { let vc = FATool.getLanuchViewController() window?.rootViewController = vc - window?.makeKeyAndVisible() +// window?.makeKeyAndVisible() languageManager.updateLanguageData { [weak self] finish in guard let self = self else { return } @@ -107,7 +107,7 @@ extension SceneDelegate { self.retryHandleOpenAppMessage() } window?.rootViewController = vc - window?.makeKeyAndVisible() +// window?.makeKeyAndVisible() } else { self.setTabBarController() self.retryHandleOpenAppMessage() @@ -118,7 +118,7 @@ extension SceneDelegate { FAAdjustStateManager.manager.isOpenApp = true window?.rootViewController = FATabBarController() - window?.makeKeyAndVisible() +// window?.makeKeyAndVisible() } } @@ -133,7 +133,6 @@ extension SceneDelegate { if FANetworkMonitor.manager.isReachable == true { handleOnLine() -// FATool.requestIDFAAuthorization(nil) self.retryHandleOpenAppMessage() FAIapManager.manager.preloadingProducts() @@ -141,6 +140,7 @@ extension SceneDelegate { if localizedData.isEmpty { self.startApp() } +// FATool.requestIDFAAuthorization(nil) } } diff --git a/Fableon/Object/Base/Controller/FATabBarController.swift b/Fableon/Object/Base/Controller/FATabBarController.swift index 99eeec2..bdddcfe 100644 --- a/Fableon/Object/Base/Controller/FATabBarController.swift +++ b/Fableon/Object/Base/Controller/FATabBarController.swift @@ -48,7 +48,6 @@ class FATabBarController: UITabBarController { } } FATool.checkUpdates() - FATool.requestIDFAAuthorization(nil) } override var childForStatusBarStyle: UIViewController? { diff --git a/Fableon/Object/Libs/FATool/FATool.swift b/Fableon/Object/Libs/FATool/FATool.swift index 14413c5..f768bee 100644 --- a/Fableon/Object/Libs/FATool/FATool.swift +++ b/Fableon/Object/Libs/FATool/FATool.swift @@ -68,7 +68,7 @@ class FATool { } extension FATool { - + static var isNeedIdfaAuthorization = true static func requestIDFAAuthorization(_ completion: ((String?) -> Void)? = nil) { if FAAdjustStateManager.manager.idfaAuthorizationFinish { completion?(ASIdentifierManager.shared().advertisingIdentifier.uuidString) @@ -77,8 +77,12 @@ extension FATool { guard FANetworkMonitor.manager.isReachable == true, FAAdjustStateManager.manager.apnsAuthorizationFinish else { return } + guard isNeedIdfaAuthorization else { + return + } + isNeedIdfaAuthorization = false - DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { ATTrackingManager.requestTrackingAuthorization { status in FAAdjustStateManager.manager.idfaAuthorizationFinish = true let idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString