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

avoid showing alert for notification while app is in foreground

hi I used this UNUserNotificationCenterDelegate for avoiding alert notification while app is in foreground with this function -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification…
MahdiM
  • 41
  • 9
0
votes
3 answers

Invalid conversion from throwing function of type '(_) throws -> Void' to non-throwing function type '([UNNotificationRequest]) -> Void

I am trying to get pending notification request on local notification. It throws me error: "Invalid conversion from throwing function of type '(_) throws -> Void' to non-throwing function type '([UNNotificationRequest]) -> Void' " My code is: var…
K.K
  • 79
  • 2
  • 8
0
votes
1 answer

UNNotificationCenterDelegate not called when dismissing

I have an AppleWatch App, which receives remote Notifications. I get a callback on my notificationCenter(_:didRecieve response:...) when handling my custom action "a1" and the default action. However, this func isn't called for the custom dismiss…
Sam
  • 819
  • 2
  • 7
  • 17
0
votes
1 answer

Swift 3: how to enable local notification and disable push notification in foreground

I am using both local and push notification in my app and i receive notification for both in background and foreground but i just want to receive only local notification in foreground.
0
votes
1 answer

How to change how a remote notification is presented before presentation?

How should I change how a remote notification is presented in iOS before the system presents it? In fact, silence it. There are times where my app has canceled a Firebase topic subscription locally, but that cancellation is not delivered to the…
0
votes
2 answers

iOS RemoveDeliveredNotifications(string[] identifier) will not delete the notification(s) when app in background

maybe someone can help me. In my app I'm using push notifications to inform the users that a new message is written to the database. One user can accept the notification and work with the content or dismiss it. If the user accepts it, a silent push…
0
votes
2 answers

How to receive scheduled notification (Local Notification) from iphone to apple watch

I would like to know that whether we can receive scheduled local notification from iphone device and we can receive that notification on Apple watch. I also want to update the status in my local database from that notification. Note: The app is…
0
votes
1 answer

WatchOS open new interface from notification without launching app

What I'm hoping to do is this: I want to have a notification on the watch that has custom actions. When one of the button actions is tapped I was hoping to have a new interface appear from the notification, but without launching the app. I want the…
rharding
  • 551
  • 1
  • 3
  • 14
0
votes
2 answers

Hiding a foreground UNNotificationAction on watchOS

My scenario: I have an app that sends push notifications about articles on a daily basis. The iOS app has three UNNotificationActions attached to the notification -- one to read the article, one to share the article, and one to save the article for…
0
votes
2 answers

Removing Remote Notifications From Notification Center

I have a requirement to aggregate remote notifications of the same type. example: if a user received a push notification saying:"user 1 commented on your post", and then received "user 2 commented on your post", when receiving the second push I…
0
votes
1 answer

UserNotifications Extension Service UNNotificationAction didReceive action delegate not getting called.

I am creating Notification Service extension for local notification with UNNotificationAction but on tap of it delegate not getting called. userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse,…
salman siddiqui
  • 882
  • 1
  • 10
  • 28
0
votes
4 answers

How to update a UITableViewCell in firstVC when a change occurs in secondVC automatically and in realtime

I have a editviewcontroller(secondVC)(which you access by tapping on the uitableviewcell task) where you get the option of setting a reminder. When you set the reminder; an icon appears in front of the task in the UITableViewCell in the firstVC.Now…
Osama Naeem
  • 1,830
  • 5
  • 16
  • 34
0
votes
0 answers

Reactive extension for UNUserNotificationCenter RxSwift

There's a crash in parameter casting: Could not cast value of type NSStackBlock (0x1030b1e78) to '(__C.UNNotificationPresentationOptions) -> ()' (0x1030b0208). 2018-02-19 17:40:31.204021+0200 [2407:480530] Could not cast value of type…
0
votes
1 answer

Triggering all pending notifications before the time set for it

In the app I'm developing, there is an option for triggering notification x amount of time before the actual time set for the said notification. For example I set the reminder for 10:00. But in the app's local settings, I set the notification to…
0
votes
3 answers

Clearing a single notification in iOS 11.2 clears them all

Since iOS 11.2, clearing a single notification from my app seems to clear them all. I can't seem to figure out what's happening as no code was changed. My UNNotificationRequest are created with GUUIDs to be universally unique (since my app allows…