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
14
votes
4 answers

Mac OS X NSUserNotificationCenter notification get dismiss event/callback

In our app we are displaying Notification Center notifications in alert style. Displaying notification works fine, as well as we get callback when user interacts with the notification either by clicking on notification or by clicking on Action…
9
votes
1 answer

NSUserNotification customisable app icon?

I just noticed that iTunes' notification icon was replaced by album covers: And it's app icon was a small one near the title, which is a bit different from the ones I knew of: Where I can only add images as part of the content, not the app…
Cai
  • 3,609
  • 2
  • 19
  • 39
8
votes
0 answers

Detect close button click on NSUserNotification

I am showing a local NSUserNotification on OS X with the following code: NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle:@"Some Title"]; [notification setHasActionButton:YES]; [notification…
7
votes
1 answer

Swift NSUserNotificationCenter didActivateNotification not working

I'm working on a swift os x application and I'm having trouble understanding the userNoticiation / didActivateNotification structure. I've reviewed the documentation and searched SO but am still stuck. Any guidance on the following code would be…
6
votes
1 answer

Swift NSUserNotification doesn't show while app is active

I am new to OSX development and I am making an app which fires a notification when something happens. But it isn't showing the notification when the app is the key app, as it is the default behavior. I want to show them even when the app IS the key…
6
votes
1 answer

NSUserNotificationCenter.defaultUserNotificationCenter() returns None in python

I am trying to connect to the Mountain Lion notification center via python. I've installed pyobjc and am following the instructions here and here. Also see: Working with Mountain Lion's Notification Center using PyObjC Here's my code: import…
5
votes
1 answer

show NSUserNotification additionalActions on click

In the image above you can see two notifications on OS X. The first one is from my app and the second is from Apple's Reminders.app. In the image you can see the otherButtonTitle 'Complete' and the actionButtonTitle 'Later'. The second…
iMaddin
  • 982
  • 1
  • 14
  • 23
4
votes
2 answers

how to include NSUserNotificationCenter in py2app

I am making an app in python 2.7 on mac osx 10.8.5 I want to show notification number of times, therefore using NSUserNotificationCenter. Notifications are coming while running code on eclipse. But, the issue is when I made app using py2app,…
imp
  • 1,967
  • 2
  • 28
  • 40
4
votes
2 answers

Cocoa / NSUserNotificationCenter get all NSUserNotification notifications

How can I be notified whenever any application delivers or activates an NSUserNotification? Neither could I determine anything that is sent via NSDistributedNotificationCenter, nor could I find a mask like NSUserNotificationDeliveredMask [dummy…
arik
  • 28,170
  • 36
  • 100
  • 156
3
votes
2 answers

NSUserNotification close calls didActivateNotification

Since MacOS 10.13 everytime I click the close button on a NSUserNotification it calls: - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification How can I prevent this or handle…
maxisme
  • 3,974
  • 9
  • 47
  • 97
3
votes
0 answers

Iphone 7 plus craches on application start With Springboard Error iOS 10

At application launch, my app is crashing with the following stack trace. The weird thing is, the app runs fine on any other iOS 10 device including the iPhone 7, but crashes on iPhone 7 Plus. The error looks to be in the new UserNotifications…
3
votes
0 answers

Add app icon to NSUserNotification

I am currently making an application that displays a notification to the user, however it does not show the application icon. Here is my code: func showNotification(message:String, title:String = "App Name") -> Void { let notification =…
iProgram
  • 6,057
  • 9
  • 39
  • 80
3
votes
1 answer

UILocalNotification always shows up as soon as I load my app regardless of the fire date

Hello I am new to swift and IOS programming. I have set up 6 notifications that are supposed to alert the user 6 times a day depending on the time of day. The alerts are working but for some reason when the app first launches all 6 alerts show up in…
gnm1978
  • 137
  • 1
  • 9
3
votes
1 answer

How can I update the subtitle in a delivered NSUserNotification?

I'm trying to update the string in the subtitle of a delivered notification (alert), I'm doing it with an NSTimer like this: [NSTimer scheduledTimerWithTimeInterval:5.0 target:self …
3
votes
1 answer

Cocoa: User Notifications never being delivered

I'm trying to deliver a local notification, it looks something like this: NSUserNotification *notification = [[NSUserNotification alloc] init]; //set title, subtitle, and sound [[NSUserNotificationCenter defaultUserNotificationCenter]…
1
2 3 4