Questions tagged [nsusernotificationcenter]

The NSUserNotificationCenter class is an Objective-C class for the OS X AppKit and delivers application notifications to the global system notification center.

The NSUserNotificationCenter class delivers user notifications to the user from applications or helper applications.

More information in developer.apple.com

58 questions
3
votes
1 answer

Is there any way of knowing how many NSUserNotifications there are in NSUserNotificationCenter?

Is there any non-private way of knowing how many notifications there are in the Notification Center (NSUserNotificationCenter) in Mountain Lion? Not just notifications from my app, but from all apps. So, to sum things up, what I want to do is to…
3
votes
2 answers

removeDeliveredNotification: doesn't

I have some code in my Mac app that performs a long-running export operation. At the end of the export, it creates a user notification to let the user know it's finished: - (NSUserNotification*)deliverNotificationWithSound:(NSString*)sound…
2
votes
1 answer

Background fetch request and notifications doesn't work in every situations

In my AppDelegate, I've added a method to do a fetch request on my Core Data, and in some case I'm showing a notification... But I see that there are some deprecated methods. I Tried to do some changes, but: When I kill my app the background mode…
2
votes
1 answer

Notifications in iOS 9 with iOS 10's UserNotifications framework

Reading here it suggests the UserNotifications framework should work fine on iOS 9, but [UNUserNotificationCenter currentNotificationCenter] is always nil for me on my iOS 9 device. Has anyone run into this issue..?
CMash
  • 1,987
  • 22
  • 35
2
votes
0 answers

Make multiple NSUserNotifications (and their action) buttons perform separate actions

I've been learning Swift at my own pace, and I've dived into notification buttons, and making them do things, after learning how to make NSUserNotifications. I know how to make a single notification's action button perform an action by using the…
Paul
  • 95
  • 2
  • 12
2
votes
1 answer

OS X: How to get userinfo when an item from notification center clicked?

I want to do some specific action when app is activated because of clicking an remote notification item from Notification Center. Which delegate will give the userinfo? -- Manoj
2
votes
1 answer

Call XPCService from within App Extension (Share)

I have an app, that is a container app for a Share App Extension and an XPC Service. The XPC Service creates a NSUserNotification and delivers it to the NSUserNotificationCenter. If I connect to the XPC Service from within the container app, I can…
2
votes
1 answer

Mac OS X 10.8 NSUserNotification alert notification don't get dismissed

In our app we are displaying Notifications in alert style. Displaying notification is working fine and we also get callback when user interacts with the notification either by clicking on notification or by clicking on Action button. But the Alert…
2
votes
0 answers

How to customize show time of NSUserNotification when using banner type

On Mac OS 10.8, the banner is shown a few seconds and disappeared automatically, so how to set the duration to show the banner with code. I also read NSUserNotification API document, it seems only has API to schedule and repeat the notification.
hanks
  • 71
  • 6
2
votes
0 answers

How to remove NSUserNotification

I am using NSUserNotificationCenter to display scheduled Notifications. I have notifications of my app in the right side notification panel so whenever I click on the notification it'll launch the app but it won't remove notification from the…
Anni S
  • 1,996
  • 19
  • 28
2
votes
5 answers

NSUserNotificationCenter not showing notifications

I'm not sure if I got something wrong but from the examples I could find. I wrote that little helloworld. #import #import int main (int argc, const char * argv[]) { NSUserNotification…
Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
1
vote
1 answer

is there a way to manage the duration of the remote notification to be displayed longer on the banner?

I am working on an App which I want the Playload notification to remain presented in the banner until the user clicks on it. I have two cases: App in background, after opening the app (not through the notification) the notification disappears.…
1
vote
1 answer

Mac App: Push Notifications Arriving, but Not Showing Up in Notification Center

I have a question about push notifications on macOS. I am successfully getting notifications in my Mac app (I can see them hit didReceiveRemoteNotification in my app delegate). But nothing actually shows up in Notification Center. The same…
1
vote
1 answer

How get notify when push notification arrive only, before tap

I have to fire two different experiments when app is in background state, When notification arrives to user but not tap yet. (this is not achieve) Out of all notifications, how many time user tap on notification alerts and open app. (this is…
kulss
  • 2,057
  • 1
  • 14
  • 16
1
vote
1 answer

ObjectiveC - how to use NSUserNotification identifier property

According to the apple docs https://developer.apple.com/reference/foundation/nsusernotification/1416410-identifier NSUserNotification has a property called identifier which is suppose to replace notifications when the identifier is the same as…