Questions tagged [unnotificationtrigger]

37 questions
13
votes
1 answer

Scheduling local notifications to repeat daily from tomorrow in Swift

I'm trying to schedule a local notification to fire every day (i.e. repeats), at a specific time, but from tomorrow. i.e "Trigger a notifcation every day at 8pm, from tomorrow" I've been using this SO question as guidance, and I believe I am doing…
Dominic Williams
  • 1,538
  • 2
  • 13
  • 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
0 answers

Random Repeating Local Notifications in Swift

TL;DR: Is it possible to have repeating, random local notifications without using APNS (or an alternative push notification service)? I am building a Core Data app that includes a bunch of objects. (We'll call them widgets.) Every day at a certain…
4
votes
0 answers

Scheduling repeating local notification in the future

Is it possible to schedule a repeating local notification in the future? I'm trying to set up a repeating notification every 10 min starting in 30 min for example. (iOS 11 Swift) I've tried using UNTimeIntervalNotificationTrigger but I'm not sure…
4
votes
1 answer

Swift UNUserNotification does not trigger sound

This is my code for UNUserNotification func scheduleNotification() { UNUserNotificationCenter.current().getNotificationSettings { (notificationSettings) in switch notificationSettings.authorizationStatus { case…
r4id4
  • 5,877
  • 8
  • 46
  • 76
4
votes
1 answer

Scheduling notification with Swift 3 for an array of dates

I have an array containing my dates. I want to schedule notifications for those days at 6.30am. I followed the appcoda tutorial which helps scheduling the notification upon input from a datepicker which is great, but I am a bit uncertain on how to…
Ben S
  • 558
  • 3
  • 18
3
votes
0 answers

Set repeat notification trigger using DateComponents

Currently working on an App need set different type of repeat rule of notification Like repeat everyday, workday, weekday or several days of the week. var dateInfo = DateComponents() dateInfo.hour = 7 dateInfo.minute = 0 dateInfo.weekday = 1 let…
3
votes
1 answer

How to sort an array of UNNotificationRequests by nextTriggerDate

I have an array of UNNotificationRequest. I want to sort them by nextTriggerDate. As far as I understand it, I would sort the array using array.sorted(by:predicate) let sortedNotifications = notificationRequests.sorted(by: {…
3
votes
0 answers

UNUserNotificationCenter removeDeliveredNotificationRequests not removing notifications when created with UNCalendarNotificationTrigger

I am using the newer notification APIs introduced in iOS 10 and working in Swift. When I create a local notification, it shows up properly, but I am trying to remove it in my app when a relevant action occurs (so that the user doesn't have to clear…
3
votes
0 answers

ios 10 swift 3 add more than 64 local notifications does not keep soonest

As we know limit of local notifications in ios 10 equals to 64. However app like water reminder requires a lot of notification per day and user can choose unique plan for each of the day. The problem is: lets say I have already stored 64…
3
votes
0 answers

Do something when local notification is presented when app is terminated or in the background

I know there's the will present method that will be called only when the app is in foreground state. Now I want the app to do something if the user ignored the notification. In this case I want present another view controller during the next launch…
3
votes
1 answer

UNLocationNotificationTrigger not triggering

I'm trying to create a notification which triggers when entering a region using UNNotificationLocationTrigger. I implemented it like this: let destination = //destination is added by user through interface// let notification =…
Codey
  • 1,131
  • 2
  • 15
  • 34
2
votes
1 answer

How to detect when a scheduled notification has been fired in Swift 4

I've created a scheduled notification and I'd like to be able to do stuff once it gets delivered. Not once it's clicked on or selected, but when it's actually delivered and shows up on the user's screen. The code I've used to generate the…
IanCZane
  • 600
  • 4
  • 21
2
votes
2 answers

Trigger UILocalNotification for every 14 days (fortnightly) Swift

The question has been already answered on SO. Here is the reference: iOS Notification Trigger: fortnightly and/or quarterly But what I have tried is so far: var fortnightPart1 = DateComponents() fortnightPart1.weekday =…
2
votes
1 answer

How to get the remaining time of pending UNNotificationRequest?

So far, after adding a UNNotificationRequest to the UNUserNotificationCenter that contains UNTimeIntervalNotificationTrigger (Here is the code that I implemented): let center = UNUserNotificationCenter.current() center.requestAuthorization(options:…
Ahmad F
  • 30,560
  • 17
  • 97
  • 143
1
2 3