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

NSUserNotification not showing action button

I'm using this code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle:…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
23
votes
11 answers

Remove application from Notification Center

Hey I was playing around with making a small cocoa application and using the new Notification Center API in Mountain Lion. However my app is now present in the notification center settings, together with Calendar, Messages and so on. As it was just…
robahl
  • 559
  • 1
  • 6
  • 13
20
votes
3 answers

NSUserNotificationCenter dismiss notification

I'm trying to use the new Mountain Lion NSUserNotificationCenter for my application (which isn't too hard actually). Posting notifications works like a charm via NSUserNotification *userNotification = [[NSUserNotification alloc]…
19
votes
3 answers

How to cancel UserNotifications

How I can disable/cancel already setted notification? Here is my schedule function. func scheduleNotif(date: DateComponents, completion: @escaping (_ Success: Bool) -> ()) { let notif = UNMutableNotificationContent() notif.title = "Your…
Denis Kakačka
  • 697
  • 1
  • 8
  • 21
18
votes
2 answers

How to implement push notification for iOS 10[Objective C]?

Can anyone help me with implementing push notification for iOS 10 as i have implemented following code but still getting problem in it: #define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v…
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…
13
votes
2 answers

Can an app use both alerts and banners in Notification Center?

I am creating a Mac OS X application to use Notification Center. Some notifications should remain on the screen until the user interacts with them, and others should disappear shortly after displaying. The NSUserNotificationAlertStyle key and…
David V
  • 11,531
  • 5
  • 42
  • 66
13
votes
1 answer

Style of NSUserNotification

A NSUserNotification only shows the action button if the user sets the style of the notifications for my app to "alerts" in the system preferences. Can I somehow set this style for my application as a default instead of relying on the user to…
tobiasbayer
  • 10,269
  • 4
  • 46
  • 64
13
votes
5 answers

Mac Mountain Lion send notification from CLI app

How can I send a notification to the notification center from a command line app? My attemps so far compile and run, but don't succeed in notifying me. Example #import int main(int argc, const char * argv[]) { NSLog(@"Running…
12
votes
1 answer

Swift & NSUserNotification - No banner or alert, but is silently added to the notification list

I am learning Swift and wanted to display a simple user notification as a test. My build is successful, but no banner is shown, instead, the notification is silently added to the list of notifications. I have verified 'Do Not Disturb' is off, I…
Isaiah
  • 1,852
  • 4
  • 23
  • 48
12
votes
1 answer

NSUserNotification - Mavericks & Custom images

In 10.9, NSUserNotification supports a new property "contentImage", which allows the use of a graphic within the notification itself. I was really hoping that there might be a way to usurp the notification screen ala iTunes' notifications, so it…
kalikkalik
  • 187
  • 8
11
votes
2 answers

NSUserNotification with custom soundName

Did anyone manage to make a NSUserNotification soundName to work with a custom sound? I tried with aif and caf format 44100KHz 16bit 2 second of duration. The notification is displayed at the proper time, with the right title and text, but the…
10
votes
1 answer

NSUserNotification - How open the app when clicked

I'm using NSUserNotification to display notifications. This is working fine. The problem is that when you click on a notification: The apps notifications are not removed from the notification center. The app (when minimized) does not open. Anyone…
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
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
3 answers

IOS 10.2 UserNotifications problems on simple Alert and Badge

Before writing this post I made a lot of researches on UserNotification Framework, that substituted UILocalNotification in IOS 10. I also followed this tutorial to learn everything about this new feature :…
Olympiloutre
  • 2,268
  • 3
  • 28
  • 38
1
2 3 4 5 6 7