Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set local notification on Mac OS X?

I'm writing an app for mac os x, and I have to display a notification every day, to remind users about something. The notification should appear even if the app isn't running, and I can't use push notification.

I guess the best solution would be local notification, just like on iOS. Also I know UILocalNotification is available on iOS only. But I think there should be an alternative solution.

Can anybody please point me in the right direction? Is it even possible? If yes, what is the best practice to do this?

like image 813
Zootyo Avatar asked Sep 21 '11 12:09

Zootyo


1 Answers

Local notifications support, very similar to iOS local notifications, has been added in MacOS 10.8 (Mountain Lion). See MacOSX10.8/Frameworks/Foundation.Framework/NSUserNotification.h for more information.
Quick usage example could be found here.

like image 149
leo Avatar answered Nov 18 '22 16:11

leo