Fix APNS remote meal predicate bug
@@ -31,6 +31,7 @@ class AppDelegate: NSObject, UIApplicationDelegate, ObservableObject, UNUserNoti
.default,
"\(DebuggingIdentifiers.failed) failed to handle remote notification with error: \(error.localizedDescription)"
)
+ completionHandler(.failed)
}
} catch {
@@ -45,8 +45,8 @@ extension TrioRemoteControl {
let results = try await CoreDataStack.shared.fetchEntitiesAsync(
ofType: CarbEntryStored.self,
onContext: taskContext,
- predicate: NSPredicate(format: "createdAt > %@", pushMessageDate as NSDate),
- key: "createdAt",
+ predicate: NSPredicate(format: "date > %@", pushMessageDate as NSDate),
+ key: "date",
ascending: false