//
//  AppDelegate.swift
//  TSLiveWallpaper
//
//  Created by 100Years on 2024/12/19.i
//

import AppTrackingTransparency
import GoogleMobileAds
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.backgroundColor = UIColor.white
        window?.makeKeyAndVisible()
        goToLoadVC()
        return true
    }


    func goToTab() {
        window?.rootViewController = TSTabBarController()
    }

    func goToLoadVC() {
        _ = TSImageDataCenter.shared
        window?.rootViewController = TSLaunchVC()
    }

    static func requestAdTrack() {
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
            ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
                // 这里可以处理用户的选择
                switch status {
                case .authorized:
                    print("授权成功，可以开始跟踪")
                case .denied:
                    print("用户拒绝了授权")
                case .restricted:
                    print("该设备的用户无法授权")
                case .notDetermined:
                    print("用户尚未做出选择")
                @unknown default:
                    print("未知状态")
                }
            })
        }
    }
}

extension AppDelegate {
}
