Bubble/Threaded/ThreadedApp.swift

45 lines
1.3 KiB
Swift
Raw Normal View History

2023-12-29 11:17:37 +01:00
//Made by Lumaa
import SwiftUI
2024-02-08 08:34:17 +01:00
import TipKit
2024-02-22 23:16:08 +01:00
import RevenueCat
2023-12-29 11:17:37 +01:00
@main
struct ThreadedApp: App {
2024-02-22 23:16:08 +01:00
init() {
guard let plist = AppDelegate.readSecret() else { return }
if let apiKey = plist["RevenueCat_public"], let deviceId = UIDevice.current.identifierForVendor?.uuidString {
#if DEBUG
Purchases.logLevel = .debug
#endif
Purchases.configure(withAPIKey: apiKey, appUserID: deviceId)
}
}
2023-12-29 11:17:37 +01:00
var body: some Scene {
WindowGroup {
ContentView()
.background(Color.appBackground)
.onAppear {
HapticManager.prepareHaptics()
}
2024-02-08 08:34:17 +01:00
.task {
2024-02-11 18:43:58 +01:00
#if DEBUG
Tips.showAllTipsForTesting()
2024-02-20 22:31:44 +01:00
UserDefaults.standard.removeObject(forKey: "lastVersion")
2024-02-11 18:43:58 +01:00
#endif
2024-02-08 08:34:17 +01:00
try? Tips.configure([
.displayFrequency(.immediate),
.datastoreLocation(.applicationDefault)
])
}
2024-02-22 23:16:08 +01:00
.modelData()
2023-12-29 11:17:37 +01:00
}
}
}
2024-01-27 08:56:54 +01:00
extension AppInfo {
static var appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
}