Post

Replies

Boosts

Views

Activity

Time Sensitive Notifications Aren't Working
I am trying to add time sensitive notifications to my task/reminder app, but I am having some difficulty. Here is the code I am using currently: let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.title = "Productivi" // that's the name of the app content.body = "\(taskObject.content)" //task content content.categoryIdentifier = "TASK_REMINDER" if #available(iOS 15,*) { print("Using ios 15 for set notification") content.interruptionLevel = .timeSensitive } For the adding notification request, that part works, however when the notification shows up, it isn't a time sensitive one. (I was testing in simulator and on my phone both running iOS 15.4) I can't figure out what else there is I have to do in order to enable the feature. I've done everything it says to do, is their an entitlement or capability I have to add. If so, what is it called and can some one please give me detailed steps on how to add that for local notifications in XCODE? Thank you, -Rohan
1
0
1.4k
Apr ’22
Duplicate Keys of Type 'EKEvent' were found in a Dictionary
I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error: Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560 I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason. If any one has seen this error and knows how to fix this I would really appreciate the help. Thanks a lot
3
0
2.1k
Jul ’21
Time Sensitive Notifications Aren't Working
I am trying to add time sensitive notifications to my task/reminder app, but I am having some difficulty. Here is the code I am using currently: let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.title = "Productivi" // that's the name of the app content.body = "\(taskObject.content)" //task content content.categoryIdentifier = "TASK_REMINDER" if #available(iOS 15,*) { print("Using ios 15 for set notification") content.interruptionLevel = .timeSensitive } For the adding notification request, that part works, however when the notification shows up, it isn't a time sensitive one. (I was testing in simulator and on my phone both running iOS 15.4) I can't figure out what else there is I have to do in order to enable the feature. I've done everything it says to do, is their an entitlement or capability I have to add. If so, what is it called and can some one please give me detailed steps on how to add that for local notifications in XCODE? Thank you, -Rohan
Replies
1
Boosts
0
Views
1.4k
Activity
Apr ’22
Duplicate Keys of Type 'EKEvent' were found in a Dictionary
I have been playing around with EventKit recently and I added a fetch request for all Events in my calendar. But after like 20 seconds after launch, I get this error: Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:56:13.202792+0200 Assisty[1779:332215] Fatal error: Duplicate keys of type 'EKEvent' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. 2021-06-22 08:57:03.745222+0200 Assisty[1779:332215] [error] precondition failure: setting value during update: 1560 I am a beginner to Xcode debugging and SwiftUI, but I can see that it thinks I have mutated something when I haven't. My app only fetches events from the user calendar and stores it in a variable of type [EKEvent]. I have no idea why this error is happening and my app is crashing left and right for no clear reason. If any one has seen this error and knows how to fix this I would really appreciate the help. Thanks a lot
Replies
3
Boosts
0
Views
2.1k
Activity
Jul ’21