Christian Mayer's Weblog

Sending Notifications to the Notification Center under OS X 10.8 Mountain Lion

Here is a sample code how to send push notification to the Notification Center under Apples OS X 10.8 Mountain Lion.

Add this to your applicationDidFinishLaunching function in the AppDelegate.m file.

NSUserNotification *note = [[NSUserNotification alloc] init];
[note setTitle:@"TestApp"];
[note setInformativeText:@"Hello World!"];
 
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
[center scheduleNotification:note];

Posted on .
Categories: Productivity, Programming
Tags: OS X, OS, X, Apple, Mountain Lion, 10.8, Push Notification Center, Notification Center, Notification, Center, XCode, Objective-C, ObjectiveC, ObjC

Categories | RSS Feed | Usage | Imprint
Copyright © 2006 by