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

All delivered Scheduled Notifications are cleared from Notification Center when one is tapped

I scheduled multiple Local Notification for the user. All of them are also delivered on their specified time. However, when I try to open any one of them from Notification Center, all of them are getting cleared. In a rightful scenario, I don't…
0
votes
1 answer

Insert text in other apps automatically - swift4

I have a simple application, which can send user UNNotification periodically. I want to insert/paste some strings into the application which is behind of the notification. For example, if the user is on the Note application on his iPhone, when he…
0
votes
1 answer

UNUserNotificationCenterDelegate didReceive response for Local Notifications not called when app is not running

I am trying to use the new UserNotifications framework for local notifications. I redirect the user to a different viewcontroller when the notification is clicked/open. The notification is not handled properly by UNUserNotificationCenterDelegate…
cauende
  • 135
  • 1
  • 11
0
votes
1 answer

Swift: Local Notifications not popping up, although request / scheduled seems to works - no errors

I am trying to learn how to use local notifications and currently I am just trying to let a notification pop up when a certain time has passed (for the sake of learning just 5 seconds). I register the notification in this function, which is used at…
0
votes
1 answer

Swift 3 - user notification custom repeat like iOS Reminders app

I want to make an app just like iOS Reminders app. My problem is the custom repeat part. We can set custom repeats like "Every 2 Months on the third Monday"(the screenshot below) but I don't know how to implement this sort of repeats with User…
Sanhood
  • 11
  • 1
0
votes
1 answer

UNUserNotification doesn't work after updating to swift 4

So I had an interacitve push notification but it suddenly stopped working, this is my code: func pushNotification(){ let content = UNMutableNotificationContent() let answer1 = UNNotificationAction(identifier: "answer1", title: "thank you!",…
nadavs
  • 11
  • 5
0
votes
0 answers

Local Notifications not firing when scheduled in the background/suspended despite Apple Docs saying they should

Local Notifications fire if scheduled in the foreground. If the app is in the background, local notifications are not scheduled, but I want them to schedule and immediately fire. Posts on this topic discuss how apps in iOS 10+ are suspended quickly…
Ryan Pierce
  • 1,583
  • 16
  • 24
0
votes
1 answer

didReceiveRemoteNotification is not receiving notifications through FCM

I've implemented Firebase Cloud Messaging as per instructions given on their website. So when I generate notification from here: And in AppDelegate.swift I've added didReceiveRemoteNotification function as: func application(_ application:…
0
votes
1 answer

User notifications (local) rescheduled?

If I schedule a local notification with unusernotificationcenter and the user then disables notifications for my app then my notification will not be delivered. This is clear. But if the user then allows notifications for my app will the…
Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
0
votes
1 answer

Swift - UNNotification center

I have multiple controllers: Home VC MyNotifVC In myNotifVC I have a list of all the pending notification. I am trying to update the number of notification in HomeVC as the notifications are delivered. So basically I would like to update a var…
Marco
  • 1,051
  • 1
  • 17
  • 40
0
votes
1 answer

How to show multiple local notifications

Background: Im writing an application where a bot sends you messages. These messages can be received as local notification. The Problem: When the bot sends multiple notifications within a short span of time (1 second between each message), the…
osebas15
  • 61
  • 6
0
votes
1 answer

How to check if UNNotifications are enabled, after asking for permission?

Currently I have the following code, which is essentially asking the user for permission to send notifications, and then checking to see if notifications are enabled: UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge,…
Spencer Milanak
  • 123
  • 2
  • 10
0
votes
1 answer

FCM notification issue - swift3

I have successfully added firebase and notification in my project. Using this Notifications are coming and I can access them by tapping on that notification. But the issue is if my app is closed, I got a notification, now without tapping on that I…
0
votes
1 answer

Repeat interval issue in userNotification

I am working on the reminder app. For eg. if I set the timings of 05:25 scheduling it to repeat at every 2 hours, it is reminded at the interval of every 2 hours but it doesn’t remind at the current time i.e. 05:25. UNMutableNotificationContent…
ikbal
  • 1,114
  • 1
  • 11
  • 30
0
votes
4 answers

Notification Wont Send If Time Contains "PM" - swift

I have some code that sends a notification at a certain time every day. The notification works for any time containing am. However, if the time contains pm the notification is not sent. I don't really know why though. Here is my code: static func…