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
2
votes
1 answer

UNNotificationContent userInfo is empty when handling response but correct when request is made

I am building a Desktop Cocoa App. When the user clicks a button, if a resource is successfully downloaded, the application sends a local notification to the user. When the user click's the notification, I want to open the URL to the source of the…
sdc
  • 2,603
  • 1
  • 27
  • 40
2
votes
1 answer

Repeating local notification not updating content

I made an app that sends a local notification showing the user a random prime number every day at 9 AM. The issue is that the shown number is always the same. The code that creates the Notification Request only gets called once (which I kind of…
user5306470
2
votes
1 answer

Local notification custom sound from URL iOS Swift

I have successfully recorded and played the voice for the local notification sound and it also get played on calling that function. But problem is when i give sound's link to the notification sound property, it do not work. notification.sound =…
Ummar Ahmed
  • 135
  • 1
  • 11
2
votes
1 answer

Is it possible to make a UNNotification expire or disappear after a certain amount of time?

Say I have a local notification for a time-sensitive event, and would like to notify my user about it on iOS. Is there a way to present a notification, and then after a certain amount of time, if the user has not viewed the notification to simply…
Gabriel Garrett
  • 2,087
  • 6
  • 27
  • 45
2
votes
1 answer

UNUserNotificationCenter need to willPresent code

I have an app written in Swift that uses UNUserNotificationCenter and I have it presenting notifications when the app is in the foreground. What I want to do is update the UI once the notification has been delivered and the app is in the foreground …
2
votes
2 answers

Dismiss UserNotificationsUI - UNNotificationContentExtensionResponseOption

I am setting multiple local Notification and I have set number of actions to notification . like snooze , show , close . func didReceive(_ response: UNNotificationResponse, completionHandler completion: @escaping…
2
votes
0 answers

Problems in UNCalendarNotificationTrigger in Swift 4

I have problems setting a notification of type UNCalendarNotificationTrigger that is determined by DateComponents //set content let content = UNMutableNotificationContent() content.title = "My Notification Management Demo" content.subtitle = "Timed…
2
votes
1 answer

is iOS VoIP push payload similar to the payload of silent notifications?

I have an app that gets silent notification from server (with UserNotifications framework) to start some process. It's work fine. For some purposes, I have to implement also VoIP push (with PushKit framework) in my app. Which changes in the the…
user9215105
2
votes
1 answer

Local notifications repeat interval using calendar triggers

I'm setting up some local notifications as reminders. So far I've been able to set a non repeating notification which triggers from a date picked from a datePicker. let dateformatter = DateFormatter() dateformatter.dateStyle =…
Marco
  • 1,051
  • 1
  • 17
  • 40
2
votes
0 answers

React to built-in alarm clock

I have heard that there isn't a specific alarm API for Apple's built-in alarm clock app, but is there a way to set up a listener to that specific alarm going off? In my case I want to send a user notification x amount of minutes after an alarm goes…
2
votes
2 answers

iOS sends the notification object to UserNotificationCenter and to didFinishLaunchingWithOptions

When the app is closed and the user taps on a notification: 1) didFinishLaunchingWithOptions is called with a remoteNotification object. I set the rootViewController here as expected 2) userNotificationCenter(_, didReceive, withCompletionHandler) is…
2
votes
1 answer

Alternative to UserNotificationCenterDelegate's willPresent when app is in background

I am trying to figure out whether I can accomplish my goal through Local Notifications, or whether I need to switch to Remote Notifications. I'm practicing iOS 10 / Swift 3 by building an alarm program that plays the latest episode of a RSS-updated…
2
votes
2 answers

How to remove a remote notification from notification center using UserNotifications framework

I have seen several threads on this here and elsewhere but none seem to be using the new UserNotifications framework for iOS 10 There is an instance method getDeliveredNotifications(completionHandler:) that is called on UNUserNotificationCenter…
Ahmed Khedr
  • 1,053
  • 1
  • 11
  • 24
2
votes
4 answers

Present a specific view controller from notification action

I'm working with local notifications and I'm trying to present a specific viewController but I have tried what I've found in this forum and I got an unusual behavior with the view shown in this picture here: And here's the source code of…
2
votes
2 answers

No such module "UserNotifications" in Swift 2.3

I'm using Swift 2.3 on Xcode 7.3.1 and when in AppDelegate I'm trying to import import UserNotifications it gives me the error that "No such module UserNotifications". What is the problem and how can I fix that? I've tried to run it on Xcode 8…
J. Doe
  • 563
  • 1
  • 9
  • 20