Post

Replies

Boosts

Views

Activity

Local Notification with repeat in Mac Catalyst
I am trying to set local notification with repeat on Mac Catalyst. It is triggering at the correct time but once triggered the notification keeps firing non-stop (only way to stop firing is to remove pending notification via code) The code I'm using(some parts excluded for clarity): NSDateComponents *dateComponents = [NSDateComponents new];   dateComponents.weekday = FRIDAY;   dateComponents.hour = 10;   dateComponents.minute = 30;   dateComponents.second = 0; UNCalendarNotificationTrigger *trigger =[UNCalendarNotificationTrigger triggerWithDateMatchingComponents:dateComponents repeats:YES]; UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:key content:content trigger:trigger]; [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil]; This code is working correctly on iOS devices.
1
0
680
May ’21
Custom Notification Sound for Mac Catalyst
I am trying to use custom sound for local notification on Mac Catalyst. It is working correctly for iPhone/iPad using UNMutableNotificationContent but the same is not working for Mac Catalyst. I have tried playing the custom sound using AVAudioPlayer and it plays correctly so I am assuming it is able to locate the file; the file is stored at Contents/Resources of the app directory. Also the sound file's duration is less than 30 seconds and is saved using .caf format.
2
1
1.1k
May ’21