// // AppDelegate.swift // PlayBTopOn // // Created by 忆海16 on 2024/11/15. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { static var shared: AppDelegate { return UIApplication.shared.delegate as! AppDelegate } static let appid = UUID().uuidString var window:UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow() window?.frame = UIScreen.main.bounds NSLog("XS- app start:\(AppDelegate.appid)") let vc = YL_PlayVC() window?.rootViewController = UINavigationController(rootViewController: vc) BbbAdManager.shared.initConfig() BbbAdManager.shared.initAd() window?.makeKeyAndVisible() return true } func applicationWillEnterForeground(_ application: UIApplication) { print("应用从后台进入前台") BbbAdManager.shared.closeAd(v: 0); } }