iap - wip

This commit is contained in:
Trey t
2022-07-17 10:26:00 -05:00
parent 6c239c5e26
commit bd238e5743
15 changed files with 897 additions and 22 deletions

View File

@@ -15,7 +15,8 @@ struct FeelsApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
let persistenceController = PersistenceController.shared
@StateObject var iapManager = IAPManager()
init() {
BGTaskScheduler.shared.cancelAllTaskRequests()
BGTaskScheduler.shared.register(forTaskWithIdentifier: BGTask.updateDBMissingID, using: nil) { (task) in
@@ -33,6 +34,7 @@ struct FeelsApp: App {
yearView: YearView(viewModel: YearViewModel()),
customizeView: CustomizeView())
.environment(\.managedObjectContext, persistenceController.viewContext)
.environmentObject(iapManager)
}.onChange(of: scenePhase) { phase in
if phase == .background {
//BGTask.scheduleBackgroundProcessing()
@@ -41,6 +43,7 @@ struct FeelsApp: App {
if phase == .active {
UIApplication.shared.applicationIconBadgeNumber = 0
iapManager.refresh()
}
}
}