108 lines
4.0 KiB
Swift
108 lines
4.0 KiB
Swift
//
|
|
// AppDelegate.swift
|
|
// SwiftProject
|
|
//
|
|
// Created by soldoros on 2024/1/10.
|
|
//
|
|
/*
|
|
com.peuid.snsdev
|
|
com.nks.vptest
|
|
|
|
蓝湖 https://moonvy.com/invite/97510620-9c5f-4af2-ab86-982a8ce4e09c
|
|
原型 https://avb2dt3u5c4.feishu.cn/docx/MRRedj0p9ocNa3x6LkycqGyqn0e
|
|
接口 https://apifox.com/apidoc/shared-088c9b06-e12a-490b-9f99-6949fb51dbbb
|
|
串流播放 https://www.finnvoorhees.com/words/reading-and-writing-spatial-video-with-avfoundation
|
|
*/
|
|
|
|
import UIKit
|
|
import SVProgressHUD
|
|
import Firebase
|
|
import FirebaseCore
|
|
|
|
@main
|
|
|
|
|
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
|
var window: UIWindow?
|
|
// var root:RootManager?
|
|
var newWindow:UIWindow?
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
// Task {
|
|
FirebaseApp.configure()
|
|
// }
|
|
|
|
SVProgressHUD.setDefaultStyle(.dark)
|
|
|
|
// self.window = UIWindow(frame: UIScreen.main.bounds)
|
|
// self.window?.backgroundColor = UIColor.white
|
|
// self.window?.makeKeyAndVisible()
|
|
|
|
Analytics.logEvent("user_launch", parameters: ["type":"new"])
|
|
SKUPay.sharedInstance.requestProducts(productsIdentifiers: MemberShipModelItem.getProductsIDs())
|
|
SKUPay.sharedInstance.setUpUserInfo()
|
|
return true
|
|
}
|
|
|
|
|
|
// func exceptionLogWithData() {
|
|
// CopyCrashHandler.setDefaultHandler()
|
|
// let str = CopyCrashHandler.getdataPath()
|
|
// let data = NSData.init(contentsOfFile: str)
|
|
// if data != nil {
|
|
// let crushStr:String? = String.init(data: data! as Data, encoding: String.Encoding.utf8)
|
|
// Analytics.logEvent("app_crash", parameters: ["crashInfo":crushStr ?? ""])
|
|
//
|
|
// CopyCrashHandler.cleanCrashInfo()
|
|
// }
|
|
//
|
|
// }
|
|
|
|
|
|
//前后台切换--进入前台
|
|
func applicationWillEnterForeground(_ application: UIApplication) {
|
|
print("applicationWillEnterForeground...")
|
|
Analytics.logEvent("user_launch", parameters: ["type":"restart"])
|
|
}
|
|
|
|
func applicationWillTerminate(_ application: UIApplication) {
|
|
|
|
}
|
|
|
|
// func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
|
// print("configurationForConnecting....")
|
|
// let scene = UIWindowScene(session: connectingSceneSession, connectionOptions: options)
|
|
//
|
|
// // Configure a window for the screen.
|
|
// self.newWindow = UIWindow(frame: CGRect(x: 0, y: 0, width: 2000, height: 1000))
|
|
// self.newWindow!.backgroundColor = UIColor.yellow
|
|
// // Install a custom root view controller in the window.
|
|
//
|
|
// let viewController = UIViewController()
|
|
// self.newWindow!.rootViewController = viewController
|
|
// self.newWindow!.windowScene = scene
|
|
//
|
|
// // You must show the window explicitly.
|
|
// self.newWindow!.isHidden = false
|
|
// NotificationCenter.default.post(name: Notification.Name(rawValue: "NSZZHHasNewWindowExternal"), object: self, userInfo: ["newwindow":self.newWindow!])
|
|
// return UISceneConfiguration(name: "External configuration", sessionRole: connectingSceneSession.role)
|
|
// }
|
|
|
|
|
|
// func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
|
// print("appdelegate configurationForConnecting.....")
|
|
// let sceneConfiguration: UISceneConfiguration
|
|
//
|
|
// if connectingSceneSession.role == UISceneSession.Role.windowExternalDisplayNonInteractive {
|
|
// sceneConfiguration = UISceneConfiguration.init(name: "External", sessionRole: connectingSceneSession.role)
|
|
//
|
|
// } else {
|
|
// sceneConfiguration = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
|
// }
|
|
//
|
|
// return sceneConfiguration
|
|
// }
|
|
|
|
}
|
|
|