nsusernotification

Is there any way of knowing how many NSUserNotifications there are in NSUserNotificationCenter?

ぃ、小莉子 提交于 2019-12-06 08:42:44
问题 Is there any non-private way of knowing how many notifications there are in the Notification Center ( NSUserNotificationCenter ) in Mountain Lion? Not just notifications from my app, but from all apps. So, to sum things up, what I want to do is to retrieve the number of notifications displayed here: I've tried to search around, but I can't find information about this. Any ideas? Thanks in advance! 回答1: There is no public API to access notifications from other apps. The best way to access this

IOS 10.2 UserNotifications problems on simple Alert and Badge

白昼怎懂夜的黑 提交于 2019-12-05 05:06:50
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 : http://useyourloaf.com/blog/local-notifications-with-ios-10/ . Today I'm encountering so much troubles to implement such trivial Notifications and since it's a recent new feature I couldn't find any solutions (especially in objective C)! I currently have 2 different notifications, one Alert and one Badge updtate . The Alert Issue Before Updating my Phone from IOS 10.1 to 10.2, I made an

show NSUserNotification additionalActions on click

无人久伴 提交于 2019-12-05 01:30:05
问题 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 notification, i.e. the one from Reminders.app behaves quite differently. It gets this little arrow pointing downwards on mouse over indicating that there are more actions when clicked. And indeed, you just need to click once on 'Later' and it will give you a

Is there any way of knowing how many NSUserNotifications there are in NSUserNotificationCenter?

走远了吗. 提交于 2019-12-04 13:37:12
Is there any non-private way of knowing how many notifications there are in the Notification Center ( NSUserNotificationCenter ) in Mountain Lion? Not just notifications from my app, but from all apps. So, to sum things up, what I want to do is to retrieve the number of notifications displayed here: I've tried to search around, but I can't find information about this. Any ideas? Thanks in advance! There is no public API to access notifications from other apps. The best way to access this information is to read the sqlite database located in ~/Library/Application Support/NotificationCenter/

NSUserNotificationAlertStyle plist key not working

纵饮孤独 提交于 2019-12-04 01:13:20
问题 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 to set the default behaviour to be alert style?? 回答1: According to these two bug reports, the key NSUserNotificationAlertStyle isn't working for anyone at the moment. http://openradar.appspot.com/12632111 http://openradar.appspot.com/12632157 回答2:

show NSUserNotification additionalActions on click

倾然丶 夕夏残阳落幕 提交于 2019-12-03 15:17:04
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 notification, i.e. the one from Reminders.app behaves quite differently. It gets this little arrow pointing downwards on mouse over indicating that there are more actions when clicked. And indeed, you just need to click once on 'Later' and it will give you a couple more options to choose from. However, I can't get the same behavior to work for my notification. I

NSUserNotification not showing action button

久未见 提交于 2019-12-03 02:13:02
问题 I'm using this code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle: @"Title"]; [notification setSubtitle: @"Subtitle"]; [notification setInformativeText: @"Informative Text"]; [notification setHasActionButton: YES]; [notification setActionButtonTitle: @"Action Button"]; [notification setOtherButtonTitle: @"Other Button"];

NSUserNotification not showing action button

放肆的年华 提交于 2019-12-02 17:16:30
I'm using this code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application NSUserNotification *notification = [[NSUserNotification alloc] init]; [notification setTitle: @"Title"]; [notification setSubtitle: @"Subtitle"]; [notification setInformativeText: @"Informative Text"]; [notification setHasActionButton: YES]; [notification setActionButtonTitle: @"Action Button"]; [notification setOtherButtonTitle: @"Other Button"]; [notification setSoundName: NSUserNotificationDefaultSoundName]; [notification setDeliveryDate: [NSDate

NSUserNotificationCenter defaultUserNotificationCenter returns null in Qt application

南笙酒味 提交于 2019-12-02 05:44:02
问题 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 = title.toNSString(); userNotification.informativeText = message.toNSString(); NSUserNotificationCenter* center = [NSUserNotificationCenter defaultUserNotificationCenter]; [center deliverNotification:userNotification]; } The problem is

NSUserNotificationCenter defaultUserNotificationCenter returns null in Qt application

我的梦境 提交于 2019-12-02 03:50:27
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 = title.toNSString(); userNotification.informativeText = message.toNSString(); NSUserNotificationCenter* center = [NSUserNotificationCenter defaultUserNotificationCenter]; [center deliverNotification:userNotification]; } The problem is NSUserNotificationCenter* center being null. I am using Qt 5.4.1, OS X 10.10. main function looks like this: int main