Questions tagged [unnotificationrequest]

A UNNotificationRequest is a new Cocoa Touch notification object introduced with iOS 10.

UNNotificationRequest is a replacement for UILocalNotification. Use this tag only for questions related to UNNotificationRequest from the UserNotifications module.

UNNotificationRequest class reference`

112 questions
65
votes
3 answers

xcode 8 push notification capabilities and entitlements file setting

when using xcode 8 doing the push notification setting, unlike xcode 7, xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ), then it will generate…
23
votes
1 answer

Convert Date to DateComponents in function to schedule local notification in Swift 3

I'm attempting to setup a function that takes in an integer and schedules a local notification n days in the future. I'm getting an error that I can't convert type Date to DateComponents. I haven't been able to figure out how to convert it. I found…
tylerSF
  • 1,479
  • 2
  • 16
  • 25
13
votes
3 answers

Limit for Local Notifications (UNNotificationRequest) in iOS 10

I know that the limit of local notifications is 64 for UILocalNotification. It's written in Apple Dev Docs. But UILocalNotification is deprecated in iOS 10. Instead this one, Apple proposes to use UNNotificationRequest. But Apple Dev Docs doesn't…
Antony Karpov
  • 131
  • 1
  • 5
11
votes
3 answers

UNUserNotificationCenter removeAllDeliveredNotifications not working in ios 11.2

I have an app with multiple local notifications. When I try to clear all the delivered notifications, I call this removeAllDeliveredNotifications method. It's working fine till ios 11.1. In ios 11.2 and above, it doesn't work as expected. The…
Sheik_101
  • 770
  • 1
  • 8
  • 24
11
votes
2 answers

How can I make UNNotificationRequest pop immediately?

I'm working with UNNotificationRequest and I want that the notification popup immediately when I click on the button. but in this case it appears when I quit the application. Here's my code @IBAction func shortNotifBtn(_ sender: Any) { let…
11
votes
1 answer

Accessing the scheduled date of a UNNotificationRequest object

I'm try to find the scheduled fire date of a UNNotificationRequest object. I'm fetching the pending notifications requests like this: UNUserNotificationCenter.current().getPendingNotificationRequests { (notifications) in let…
glv19
  • 474
  • 6
  • 16
9
votes
0 answers

UNUserNotificationCenter unit tests

I try to test a simple method which are supposed to create and deliver a notification for iOS 10. func displayPlaceNotificationContent() { let unMutableNotificationContent = generateNotification() let trigger =…
zed13
  • 357
  • 4
  • 21
9
votes
3 answers

How do I set an NSCalendarUnitMinute repeatInterval on iOS 10 UserNotifications?

In UILocalNotification we use NSCalendarUnitMinute like repetition ..... but I can't find in iOS 10 UserNotification doc ... How can I use NSCalendarUnitMinute like repetition in iOS 10 UserNotification? here is the code which will schedule local…
S.J
  • 3,063
  • 3
  • 33
  • 66
7
votes
2 answers

How to cancel a local notification trigger in Swift

I have a trigger to show a notification to the user: let content = UNMutableNotificationContent() content.title = "Title" content.body = "Body" content.sound = UNNotificationSound.default let trigger =…
Chief Madog
  • 1,738
  • 4
  • 28
  • 55
6
votes
1 answer

Before iOS 15, I was able to send sound only local notification, Now I have to show banner

This was working good before iOS 15 let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.sound = UNNotificationSound.init(named:UNNotificationSoundName(rawValue: sound)) let request =…
iTarek
  • 736
  • 1
  • 8
  • 17
6
votes
1 answer

Have UNNotification trigger across timezones

I can't have a iOS 10 local notification (UNNotification) fire properly across time zones. In time zone +10 hours, I want it to fire at 17:00:00, and schedule it. Later when I look at what notifications are scheduled, I get the next firing date of…
Jonny
  • 15,955
  • 18
  • 111
  • 232
5
votes
1 answer

UNUserNotificationCenter.current().getDeliveredNotifications only returns empty array

I am trying to retrieve all delivered notifications still showing in the notification center but UNUserNotificationCenter getDeliveredNotifications(completionHandler:) just doesn't work. I can get all the pending notifications with…
5
votes
2 answers

Cancel UNNotificationRequest

Because UILocalNotification is now deprecated, I moved my code to the new UNNotificationRequest API. It states: 'cancelLocalNotification' was deprecated in iOS 10.0: Use UserNotifications Framework's -[UNUserNotificationCenter…
coyer
  • 4,122
  • 3
  • 28
  • 35
5
votes
1 answer

Get local notification's body text or identifier in AppDelegate Swift

I want to access my application data in AppDelegate.swift whenever the app receives an action response. I was trying to use the func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse,…
Eric Hua
  • 976
  • 2
  • 11
  • 29
5
votes
3 answers

Local Notifications make sound but do not display (Swift)

I am trying to create a local notification for my app using Apple's UNUserNotificationCenter. Here is my code: let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.title = task.name content.body =…
Matt Butler
  • 476
  • 6
  • 21
1
2 3 4 5 6 7 8