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
1
vote
0 answers

Change NSUserNotification shown time

I have NSUserNotification NSUserNotification *n = [NSUserNotification new]; n.title = self.title; n.subtitle = self.subtitle; [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:n]; But i cant control it banner showing time…
Andrey
  • 11
  • 1
1
vote
1 answer

Display NSUserNotification when app is active

I am currently making a XIB Menu Bar application that displays a notification using this code: func showNotification(message:String, title:String = "App Name") -> Void { let notification = NSUserNotification() notification.title = title …
iProgram
  • 6,057
  • 9
  • 39
  • 80
1
vote
1 answer

How to remove notification banner but leave it in notification centre on OS X?

What i'm doing now: [[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications]; So my question is, how to leave notification in notification center?
1
vote
1 answer

Display banner for NSUserNotification while app is frontmost

I want to display user notifications while the app is frontmost. I found the code below, but I'm not sure how to use the delegate: it seems to just return a boolean value. class MyNotificationDelegate: NSObject, NSApplicationDelegate,…
CY.L
  • 35
  • 1
  • 5
1
vote
0 answers

Set a custom time a NSUserNotification is displayed

I create a NSUSerNotification in the following way: NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle:notificationTitle]; [notification setInformativeText:_informativeText]; [notification…
1
vote
0 answers

OS X open my old version program(test0.1.0.app) when I click it's user notification. Why?

There are several version programs in my mac. Test0.1.0.app, Test0.2.0.app and Test0.4.0.app which i build it just now with xcode5.0. Test0.1.0.app in somewhere. Test0.2.0.app in somewhere. Test0.4.0.app in…
Yifan Wang
  • 504
  • 6
  • 13
1
vote
2 answers

Have main app open with NSUserNotification posted from helper

I have a helper application that is active when the GUI app is not. The helper application is posting notifications to [NSUserNotificationCenter defaultNotificationCenter]. I'd like to have the GUI app open when the user activates a notification…
1
vote
1 answer

how to set the default to NSUserNotificationAlertStyle the Alerts notification

I am new to iOS. The app I am working on has in Settings under Notification Center the Alert style set by default to Banners. I would like to change that to Alerts. How can I do that? After doing some search on google i found that this should be…
1
vote
1 answer

Issue with PerlObjCBridge and the OS X notification center

I am trying to connect a pre-existing perl script to the Mac OS 10.8/10.9 notification center. The following code is what I have tried, and for some reason I can not get it to work: #!/usr/bin/perl use strict; use warnings; use Foundation; my…
1
vote
3 answers

How to install pync on mac

I want to install pync on mac for showing notification. I tried with $ pip install pync git clone git://github.com/SeTeM/pync.git cd pync python setup.py install sudo easy_install pync Showing error as : Last login: Thu Nov 21 12:20:51 on…
0
votes
0 answers

NSUserNotificationCenter.default.deliver not work

I googled a lot, but found nothing. Here is my code: a.swift import Foundation import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { func showNotification() -> Void { var notification =…
kruztw
  • 23
  • 3
0
votes
2 answers

Trying to get NSUserNotifications to work in my app

I am trying to update to NSUserNotifications. I have changed how my code is written and changed where it is place but the same thing keeps happening. In my AnotherViewController.h #import #import…
user1114881
  • 731
  • 1
  • 12
  • 25
0
votes
1 answer

defaultUserNotificationCenter causing 'unrecognized selector' error in C++

I am trying to access defaultUserNotificationCenter in my C++ application and I cannot seem to get this working. The code below is causing the error: [NSUserNotificationCenter defaultUserNotificationCenter]: unrecognized selector sent to instance…
0
votes
1 answer

fired local notification at specific time

please i have an issue about how can i trigger the local notification at specific time ? without user trigger it and need the app at specific time fired local notification the following my code : this is for get permission from the user func…
Mustafa
  • 253
  • 1
  • 7
  • 15
0
votes
1 answer

Remove scheduled notifications on Mac OSX

I used C#/Mono to schedule a notification with NSUserNotificationCenter like so: var not = new NSUserNotification(); not.Title = ...; not.DeliveryDate = ...; not.DeliveryRepeatInterval = new NSDateComponents() { Second =…