Questions tagged [usernotifications]

iOS 10, macOS 10.14, Mac Catalyst 13, tvOS 10 and watchOS 3 UserNotifications framework

The UserNotifications framework (UserNotifications.framework) supports the delivery and handling of local and remote notifications starting in iOS 10, macOS 10.14, Mac Catalyst 13, tvOS 10 and watchOS 3. Class names start with "UN". See https://developer.apple.com/reference/usernotifications.

182 questions
94
votes
14 answers

Delete a particular local notification

I am developing an iPhone alarm app based on local notifications. On deleting an alarm, the related local notification should get cancelled. But how can I determine exactly which object from the array of local notifications is to be cancelled? I am…
Yogi
  • 3,578
  • 3
  • 35
  • 56
31
votes
0 answers

How can I skip the first occurrence of a repeating UNCalendarNotificationTrigger?

Say today is a Monday and it's 1 PM. I want to schedule a weekly local notification from my iOS app starting today at 2 PM. I'd do this: NSDateComponents *components = [[[NSDateComponents alloc]init]autorelease]; components.weekday =…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
29
votes
5 answers

Enable or Disable Iphone Push Notifications inside the app

I have a iphone app which is enable to receive push notifications. Currently i can disable push notifications for my app by going to the iphone settings/Notifications. But i want to add a switch or button inside my app to enable or disable push…
13
votes
3 answers

Check whether user notifications are enabled after UILocalNotification deprecation

In my app, I want to be able to check if the user has notifications enabled or not. In iOS 10, I did this using a check in the delegate. This check is now deprecated and I want to update it, but I can't figure out what to use in iOS 11. The…
Ethan Humphries
  • 1,786
  • 3
  • 19
  • 28
13
votes
2 answers

iOS 10 UNNotificationAction Open App from Background

How can I open my app, when user receive notification and my app was in background? Of course tap on notification itself would open app, but how to handle it with custom notification action? I have implemented UNUserNotificationCenterDelegate and…
11
votes
2 answers

Is the iOS Local Notification Limit Per Day?

I'm working on an app where I need to send a good amount of notifications to the user daily. Around 5-40 depending on the user. I'm using local notifications to send it, but I know there is a 64 notification limit. Does this mean 64 notifications…
Psonthalia
  • 179
  • 1
  • 12
11
votes
4 answers

UNNotificationAttachment failing to attach image

So the following code is being used to attach an image from local storage url of an image. I check in Terminal to see if the image is stored and it does store the image without any issues. So ruling out any issues with the url itself. do { let…
11
votes
2 answers

How to schedule a local notification in iOS 10 (objective-c)

I'd like to schedule local notifications using iOS 10. I'd like to know how to do this. I've looked all around the web, but I keep finding clues only for registering and handeling the notifications. Not for the scheduling of a local…
Developer
  • 406
  • 1
  • 4
  • 18
10
votes
1 answer

Does UNTimeIntervalNotificationTrigger nextTriggerDate() give the wrong date?

I’m updating my localnotifications to work with iOS 10 and I’ve run into an issue where I think the nextTrigger function returns NOT “The next date at which the trigger conditions will be met.” but instead returns whatever the current date time is…
Craig Robertson
  • 211
  • 2
  • 7
9
votes
3 answers

APNS rejects notification with reason "DeviceTokenNotForTopic"

I'm receiving this error only when trying to register for remote notifications using UserNotifications framework. When using PushKit everything works ok. dispatch_queue_t mainQueue = dispatch_get_main_queue(); // Create a push registry…
9
votes
2 answers

Repeat UserNotification every specific day of week for iOS 10

I'm working on local notification scheduling module for iOS 10 which repeats local notification for example every Sunday or every Monday..etc. Lets say i scheduled a notification for this date which is 2016-12-27 10:53:22 +0000 and using…
AaoIi
  • 8,288
  • 6
  • 45
  • 87
9
votes
1 answer

didReceiveLocalNotification not getting called after using UNUserNotificationCenter

I am scheduling local notifications. It works in iOS 9.x but since iOS 10 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification doesn't get called when app is running on iOS 10. I know that…
8
votes
1 answer

Local notification sound not playing while app in background - Swift

I'm making an alarm clock app, and I have confirmed that my alarm notifications are being triggered correctly, but the sound does not always play as I expect. For instance, when the phone is not in silent mode, the notification plays the sound…
8
votes
2 answers

Usernotification framework badge does not increase

I am using UserNotification framework in my app and sending local notifications (not push notifications), and I want to set the badge to the number of notifications received so what I did was to set the number of notifications received into a user…
King
  • 1,885
  • 3
  • 27
  • 84
8
votes
1 answer

How to handle UserNotifications Actions in iOS 10

So I am able to schedule notifications like so; //iOS 10 Notification if #available(iOS 10.0, *) { var displayDate: String { let dateFormatter = DateFormatter() dateFormatter.dateStyle = DateFormatter.Style.full return…
A.Roe
  • 973
  • 3
  • 15
  • 34
1
2 3
12 13