372 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
2
answers
561
views
UNUserNotificationCenter UNNotificationSettings non-sendable problem
I'm trying to get the UNAuthorizationStatus from the UNUserNotificationCenter on a MainActor class, but I get a non-sendable error on the UNNotificationSettings.
import UserNotifications
@MainActor
...
0
votes
0
answers
34
views
getDeliveredNotifications does not return notifications triggered by UNLocationNotificationTrigger
I am trying to retrieve delivered notifications using UNUserNotificationCenter.getDeliveredNotifications(completionHandler:), but I have encountered an issue:
Notifications triggered by ...
0
votes
0
answers
90
views
Persist and deliver scheduled local notifications after iOS app update
I have an app available for download in the Apple App Store. The app sends local notifications, which are scheduled at the user's request. I've recently learned that when new versions of my app are ...
0
votes
0
answers
79
views
Swift Mocking a throwing function
I'm building the unit tests for my project and I encountered a problem about a mock I use for UNUserNotificationCenter.
I oversimplified my code as an example:
I use a protocol to Mock the add() ...
0
votes
1
answer
156
views
Debugging a Crashlytics Crash Report: UserNotificationCenter: DidReceiveNotification
On one of our apps we have received several crashes and I am unable to determine what is happening. I have reloaded the app on my phone and have tried to get it to crash but so far it's working as ...
-1
votes
1
answer
56
views
How to Perform Actions When a Local Notification is Delivered in iOS Without User Interaction?
I'm currently working on an iOS application where I need to perform certain actions (like logging) when a local notification is delivered. However, I want these actions to be executed even if the user ...
0
votes
1
answer
443
views
How to decrease badge number in iOS 17, applicationIconBadgeNumber was deprecated?
I want to decrease my badge number by one when a user taps a button. The badge number could be 4 for instance so I don't want it to be reset to zero directly.
I wanted to use this code but it was ...
0
votes
1
answer
253
views
Local Notifications not getting triggered in IOS when app is running on background
Hello I have this function which I am calling from DispatchSourceTimer when the app is in background and the timer is running for every 5 mins
private func scheduleNotification() {
...
1
vote
1
answer
174
views
How can I send an iOS local push to a specific date and schedule it weekday for a particular time?
I want to add and send an iOS local push notification to a specific date and want to schedule it by weekday for a specific time (hour, minute). I wanted to send this reminder weekday-wise but want to ...
0
votes
1
answer
123
views
Schedule local notifications on only weekdays and between 8am to 5pm in Swift
I'm trying to schedule local notifications on only weekdays, between the 8am to 5pm.
Need to trigger a local notification on given time interval.
func scheduleNotifications(timeInterval: Int) {
...
0
votes
1
answer
529
views
IOS warning: instance method 'userNotificationCenter(_:willPresent:withCompletionHandler:)' nearly matches optional requirement
In an iOS project, I have implemented the following delegate method to handle Notifications when app is in foregorund:
func userNotificationCenter (_ pNotificationCenter : UNUserNotificationCenter, ...
0
votes
0
answers
110
views
Nothing happens when Notification with closed App clicked [duplicate]
When I click on the Notification when the App is closed, no prints are outputted, but I'm waiting for "app opened from PushNotification tap 2".
When the App is in background mode, everything ...
2
votes
0
answers
944
views
App crashes when I'm getting UNUserNotificationCenter.current() from into a Swift Package
This is the context:
I'm implementing Unit Tests into an internal Swift Package. A method into one Unit Test is trying to get Notification Center reference from UNUserNotificationCenter.current() and ...
0
votes
3
answers
872
views
Swift Local Notifications in Do Not Disturb
I have a SwiftUI Timer App and I want the user to get notified when the timer runs out. I currently do this with just a local notification.
let content = UNMutableNotificationContent()
content.title = ...
0
votes
0
answers
147
views
Delivered local notifications not shown in notification center
I have a SwiftUI app. I created a NotificationCenter class to deliver local notifications, which includes the following function.
@MainActor
struct NotificationCenter {
// Remove deleted items ...