Questions tagged [nsusernotification]

NSUserNotifications are a key component of the programmatic interface to Notification Center

NSUserNotifications are a key component of the programmatic interface to Notification Center, a new technology introduced in Mac OS X 10.8 ("Mountain Lion"). Notification Center allows applications to show iOS-inspired notifications in the upper right corner of a user's screen; these notifications are also collected into a sidebar users can view on demand.

104 questions
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…
8
votes
4 answers

NSUserNotificationAlertStyle plist key not working

I am working on sample user notification on 10.8 however the key NSUserNotificationAlertStyle when i set it to alerts not working, my application still shows it as banner, the only way to control it through the system preference but what if i want…
8
votes
1 answer

Working with Mountain Lion's Notification Center using PyObjC

I'm trying to send notifications to Mountain Lion from my python script and react to clicks on the notifications. Sending the notifications works perfectly find by now. But yet I was not able to get Lion to call back my script upon a click. Here is…
koloman
  • 711
  • 7
  • 19
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

Using OS X 10.8 Notification Center (NSUserNotification) with Java

I'm struggling with the notification center in OS X 10.8. I wrote a wrapper to provide Java access to the NSUserNotification and NSUserNotificationCenter classes via JNA, however the functionality is limited. I am able to send a notification and it…
Geoff
  • 316
  • 2
  • 7
6
votes
4 answers

Custom icon for each NSUserNotification?

Is there any way to provide custom icons for each NSUserNotification, instead of the default app logo? Like the iconData parameter in Growl. I want to show "Someone has just posted something" with the photo of this "someone".
zavié
  • 4,301
  • 2
  • 34
  • 46
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

Swift: Action if the user accepted or rejected notifications

I'm using the following code to request push and local notification permission: let application = UIApplication.shared let settings: UIUserNotificationSettings = UIUserNotificationSettings( types: [.alert, .badge, .sound], categories: nil…
MVZ
  • 2,220
  • 5
  • 27
  • 57
4
votes
2 answers

Detect Other Button click (NSUserNotification)

I've searched all over the internet but the only method found was by looping through - (void)userNotificationCenter:(NSUserNotificationCenter *)center didDeliverNotification:(NSUserNotification *)notification just as shown in:…
Brave Heart
  • 517
  • 3
  • 16
4
votes
1 answer

Cocoa: NSUserNotification appears behind NSPopover

I have no idea where to even start trying to fix this but maybe someone can point me in the right direction. I have a status item application that shows a popover when clicked, some user interactions produce an NSUserNotification to warn/inform…
Elbimio
  • 1,041
  • 2
  • 10
  • 25
4
votes
0 answers

NSUserNotification size OS X

I have this code that allows me to display notifications. NSUserNotification *notification = [[NSUserNotification alloc] init]; notification.title = [NSString stringWithFormat:@"%@ (%@)",titre, numero]; notification.informativeText =…
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
1 answer

Change OSX Notification Center icon at runtime

Is there (now) a officially supported way to change the OSX Notification Center's Icon for NSUserNotifications while my App is running? I searched the web, but the answers weren't really "recent", so I just wanted to double check. I'd like to show…
blub
  • 1,014
  • 7
  • 18
4
votes
1 answer

Cocoa: Forcing an NSUserNotification while app is frontmost

Fairly straightforward, I have an app that should send a notification but it will not do so if the application is frontmost. From the NSUserNotificationCenter class reference: The user notification center reserves the right to decide if a …
Elbimio
  • 1,041
  • 2
  • 10
  • 25