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
3
votes
1 answer

objective-c NSUserNotification header title

Does any one know which value is being used for the title in the header bar for the system notification that is sent from the application? Let's assume my app is named "My.app Name", the header title just says "My". I'm talking about this…
Thunder
  • 611
  • 1
  • 8
  • 25
2
votes
1 answer

What's the Difference Between NSUserNotification and UNUserNotification in macOS?

I have the following lines of code to post a notification by clicking on the Test button. import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate { func userNotificationCenter(_…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
2
votes
2 answers

How to update badge number when receive push notification

I need help finishing this piece of code so the app will show badge number when a push notification is received, I can receive push notification, but just no badge on app, here is the code func application(_ application: UIApplication,…
Daniel.wu
  • 31
  • 1
  • 5
2
votes
0 answers

iOS - Notification on NSUserDefaults Change When App Is In Background

I have two applications that share an app group @"group.edu.tds.poc.shared" Using NSUserDefaults of this app group, I am able to exchange data between the reader app and the writer app. The Writer App writes data to the NSUserDefault NSUserDefaults…
Sandeep T D S
  • 481
  • 3
  • 15
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
2 answers

No such module "UserNotifications" in Swift 2.3

I'm using Swift 2.3 on Xcode 7.3.1 and when in AppDelegate I'm trying to import import UserNotifications it gives me the error that "No such module UserNotifications". What is the problem and how can I fix that? I've tried to run it on Xcode 8…
J. Doe
  • 563
  • 1
  • 9
  • 20
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
2 answers

How to receive local notification in watchOS 2

As I can read in guideline notifications are displayed automatically. But.. not for me. The question is why? My iOS app send notification after 4 seconds when user tap the button: @IBAction func stopTimerPress(sender: AnyObject) { …
Mr. A
  • 704
  • 1
  • 7
  • 16
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

NSUserNotificationCenter defaultUserNotificationCenter returns null in Qt application

I have a simple test Qt application which tries to send user notification on OS X: void Mac::notify(QString title, QString message) { NSUserNotification *userNotification = [[[NSUserNotification alloc] init] autorelease]; userNotification.title…
psyched
  • 1,859
  • 1
  • 21
  • 28
2
votes
1 answer

Pop up created by CFUserNotificationCreate is not coming to front

This is bit tricky situation. I want to display a dialogue to the user from daemon, that dialog should come in front of all other open windows on screen. In regular cases CFUserNotificationCreate just working fine. But say open xcode from that try…
user12345
  • 425
  • 1
  • 3
  • 14
2
votes
1 answer

Getting app. icon on Notification Banner

I have NSUserNotification working in my application. For some reason I get the generic icon image on the notification alert/banner instead of the application icon. The app. icon has been properly added. It builds fine and the icon is displayed on…
Paul
  • 189
  • 10
2
votes
1 answer

Cocoa: Programmatically set NSUserNotification type

In the Notifications setting pane users can specify if they want an individual app to display notifications as alert, banners, or none. Some of the notifications in my app can work as either, but some are just quick error messages that don't require…
Elbimio
  • 1,041
  • 2
  • 10
  • 25
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