AppDelegate.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // AppDelegate.swift
  3. // TSLiveWallpaper
  4. //
  5. // Created by 100Years on 2024/12/19.i
  6. //
  7. import GoogleMobileAds
  8. import UIKit
  9. @main
  10. class AppDelegate: UIResponder, UIApplicationDelegate {
  11. var window: UIWindow?
  12. func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  13. window = UIWindow(frame: UIScreen.main.bounds)
  14. window?.backgroundColor = UIColor.white
  15. window?.makeKeyAndVisible()
  16. initAdMob()
  17. addNetListener()
  18. goToTab()
  19. return true
  20. }
  21. func initAdMob() {
  22. GADMobileAds.sharedInstance().start { status in
  23. print("启动状态 == status === \(status.adapterStatusesByClassName)")
  24. }
  25. }
  26. func goToTab() {
  27. window?.rootViewController = TSTabBarController()
  28. }
  29. func goToLoadVC() {
  30. _ = TSImageDataCenter.shared
  31. window?.rootViewController = TSLaunchVC()
  32. }
  33. func addNetListener(){
  34. TSNetworkShard.monitorNetworkPermission { success in
  35. if success {
  36. PurchaseManager.default.requestProducts()
  37. }
  38. }
  39. }
  40. }
  41. extension AppDelegate {
  42. }