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
2
votes
2 answers

UNNotification: Custom Sound for LocalNotification is not playing in iOS10

I'm firing a local notification. Since UILocalNotification class is deprecated in iOS 10, I have used UserNotifications.framework. When I try to set the custom sound for the notification, the default sound is playing all time. Here is my code: -…
Suhas Arvind Patil
  • 1,732
  • 1
  • 19
  • 31
1
vote
0 answers

Delay UNLocationNotificationTrigger on UNNotificationRequest?

I have properly set up location based local notifications. As of now the user receives a notification when they enter a defined zone (CLCircularRegion). Id like to delay that notification about 10 minutes after they enter the zone, could that be…
robotos
  • 194
  • 11
1
vote
1 answer

How do I create a notification that will be triggered every 8 in 8 hours, 12 in 12, programmatically in Swift iOS

I'm creating an app to notify the user to take his Medicine. I'm already storing your selection of periods, like, 2 in 2 hours, 8 in 8, etc. I'm converting to a double and then multiplying by 3600 in the addingTimeInterval method, as shown…
1
vote
1 answer

How to set a local notification to fire on the last day of each month using UNNotificationRequest?

I was trying to set up local notifications to fire on the last day of each month regardless of whether it's the 28th, 29th, 30th, or 31st. With the previous framework UILocalNotification I could specify the fireDate and repeatInterval and it worked.…
Bonan
  • 709
  • 4
  • 18
1
vote
2 answers

Why local notification is not firing for UNCalendarNotificationTrigger

The local notification is supposed to fire at 25-9-2021. Here is the print object of fire time ▿ year: 2021 month: 9 day: 26 isLeapMonth: false year : 2021 month : 9 day : 25 isLeapMonth : false let content =…
1
vote
1 answer

How do I schedule a notification at a specific time, and then repeat it every x amount of time?

I am making a reminder app where you can schedule a reminder, that will then repeat every x seconds/minutes/hours/days etc. If I want it to repeat every x amount of time I can do it like so: func addNotification() { let content =…
Peter Ruppert
  • 1,067
  • 9
  • 24
1
vote
0 answers

Cancel a repeating UNNotification for today only

I am scheduling daily repeating notifications by setting only hour, minutes and seconds: func addNotification(fireDate: Date) { let notificationCenter = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() …
1
vote
1 answer

Local Notifications not working on independent WatchOS App

I cannot figure out, how I can schedule local notification in independent WatchOS APP In my extension delegate I try to setup it let center = UNUserNotificationCenter.current() func applicationDidFinishLaunching() { center.delegate…
1
vote
1 answer

UNNotification Local Notification and Do Not Disturb

Sleep Cycle app manages to send a Local Notification and play a sound even when I have 'do not disturb' enabled on my phone. How do you do this?
bandejapaisa
  • 26,576
  • 13
  • 94
  • 112
1
vote
1 answer

Unable to parse gcm.notification.data from push notification

I am unable to get Data Dictionary from Firebase push notification . My Code : class func parseIncommingMessages(notification:UNNotification) { print("PushNotifications: \n \(notification.request.content.userInfo.debugDescription)") let…
1
vote
0 answers

UNUserNotification for next 15 days for taking medicine

I have a scenario where I want to add a local reminder of medication. The reminder can be daily or weekly of all medication which I used and duration of medicine can be in months. I already know that there is only 64 notification/app limit in iOS.…
1
vote
1 answer

iOS 10 UNNotification doesn't show alert

The code is very easy: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound,…
fujianjin6471
  • 5,168
  • 1
  • 36
  • 32
1
vote
1 answer

How to detect host app state in a Notification Service Extension?

A Notification Service Extension downloads a media file to display it as attachment of the UNNotification. However when the host app is in foreground, no notification is displayed, so it is unnecessary to for the notification extension to download…
Manuel
  • 14,274
  • 6
  • 57
  • 130
1
vote
1 answer

UNNotification local notification user tap does not trigger delegate when app in background iOS 11

I have an app that alerts the user every x minutes via UNNotification local notification. If the user does not respond, the iOS lock screen shows a series of banners asking for user response. Most of the time, a user tap on the banner (after a tap…
Nelson Capes
  • 411
  • 3
  • 12
1
vote
1 answer

Retrieving next request date and associated ID for UNNotificationRequest

Update: I needed to find the next notification request and the associated ID so I ended up going with this: UNUserNotificationCenter.current().getPendingNotificationRequests { (requests) in var requestDates = [String:Date]() …
Travis S.
  • 343
  • 1
  • 4
  • 14