Questions tagged [unusernotificationcenter]

Manages the notification-related activities for your app or app extension. Local notifications and push notifications are both ways for an iOS application that isn’t running in the foreground to let its users know it has something for them. Use this tag for the queries related to the new Rich Notifications introduced in Swift 3.

Use the shared UNUserNotificationCenter object to schedule notifications and manage notification-related behaviors in your app or app extension. The shared user notification center object supports both local or remote notifications in varying capacities. Use this object to perform the following types of tasks:

  • Request authorization for displaying alerts, playing sounds, or badging the app’s icon in response to local or remote notifications. (Authorization is required for all user interactions.)

  • Declare the notification types that your app supports and the custom actions (if any) that the user may perform when those notifications
    are delivered.

  • Schedule the delivery of notifications from your app.

  • Manage app-specific notifications displayed in Notification Center.

  • Get the notification-related settings for your app.

The notifications that you schedule directly from your app are known as local notifications because your app creates them locally on the user’s device. By contrast, remote notifications are created by your own server and delivered to the user’s device via the Apple Push Notification Service (APNS).

370 questions
0
votes
1 answer

How to set local notification for only particular date with time 12PM and 6PM

In my application, I need to trigger a fake notification on a particular date with time 12PM and also 6PM. I have created and scheduled local notification in "UILocalNotification" category file. UILocalNotification+TZT.h file : #import…
0
votes
2 answers

Calendar Based Local Notification Not Working - Swift 3

I have setup a local notification system so that I can fire a notification at a certain time every day. This time is determined by the user and I store it as a string. I will break down all the steps I have done in the code to follow but basically,…
0
votes
1 answer

iOS open page from local notification

I currently have a local notification firing from a specified time in OS10 using the UNUserNotificationCenter. I'm trying to figure out how to open a specific page in my app when the user taps on the local notification. Anyone how to do this I'm…
B Best
  • 1,106
  • 1
  • 8
  • 26
0
votes
1 answer

How can I set the Local notification which fire every seconds after first set notification?

What I want that, I set the local notification for 7:00 am and as its fire immediately, notification comes continuously till the user not perform any action on notification or open the app. below is code to send notification first time let…
0
votes
1 answer

Daily Reminder on iOS

I used the following code to trigger a daily reminder: let triggerDate = calendar.date(from: calendarComponents) let triggerDaily = Calendar.current.dateComponents([.hour, .minute, .second], from: triggerDate!) let trigger =…
user6539552
  • 1,331
  • 2
  • 19
  • 39
0
votes
1 answer

Call Sequence of willPresentNotification with UNUserNotificationCenter and UNNotificationServiceExtension

When there is a UNNotificationServiceExtension for the category of the notification, does iOS call userNotificationCenter: willPresentNotification: withCompletionHandler: before or after the extension?
0
votes
2 answers

Action buttons on Remote Notification iOS 10 (objective C) is not coming IIViewDeckController

After lot of googling and following apple's doc , still I am not able to get action button in remote(push) notification but I am getting it in local notification by following the same code for local notification. -…
0
votes
2 answers

Send notification again

I'm sending a notification to the user with the following code using UNTimeIntervalNotificationTrigger. The notification is sent after 1 hour, that works. Now I want to give the user the ability to reset the TimeInterval for the notification so that…
G Buis
  • 303
  • 4
  • 17
0
votes
1 answer

Reset UNTimeIntervalNotificationTrigger with button

I'm trying to reset a UNTimeIntervalNotificationTrigger to sent a notification multiple times. I've tried a few things, including: -Set repeats: true -> This crashes my application somehow, giving me the error thread 1 signal sigabrt Now the…
G Buis
  • 303
  • 4
  • 17
0
votes
1 answer

How to update the daily local notification message in iOS 10?

I'm trying to find out how to update the message in the local notifications when it is repeated daily. Currently I have the following code in my AppDelegate: func scheduler(at date: Date, numOfNotes: Int) { let calendar = Calendar(identifier:…
Pangu
  • 3,721
  • 11
  • 53
  • 120
0
votes
1 answer

Repeating local notifications iOS 10

Has anyone been successful at scheduling a repeating hourly local notification with UNUserNotificationCenter without creating multiple request? I need to be able to schedule hourly notifications to go off at a specific minute from which the first…
bevbomb
  • 689
  • 2
  • 12
  • 26
0
votes
2 answers

iOS 10 (Swift) Reject Notification Permissions

I want to have a UISwitch in my app that when pressed will either request notification authorization or if already authorized reject it. Is there a way to perform a rejection? I know that if requestAuthorization is called and the user has already…
mocode9
  • 229
  • 3
  • 16
0
votes
1 answer

where is the none case used in notifications?

let types: UIUserNotificationType = [.alert, .sound, .badge, .none] let settings = UIUserNotificationSettings(forTypes: types, categories: nil) application.registerUserNotificationSettings(settings) or this code: guard let settings =…
0
votes
0 answers

How use notifications for iOS 10 without UserNotifications framework for OneSignal and Swift 2.3?

I'm trying to let me users receive notifications over OneSignal, but I'm using Swift 2.3 and have an older Macbook that cannot upgrade to XCode 8. Is this possible? And how? Here is the suggested OneSignal Swift Code... …
Charles Jr
  • 8,333
  • 15
  • 53
  • 74
0
votes
1 answer

How to detect when a user does not tap into a notification? (Xcode 8, iOS 10)

I'm working with local notifications again and with the new UserNotifications framework, and I just want to ask is there a way to detect when the user does NOT tap into a notification?
techcoderx
  • 602
  • 1
  • 7
  • 21