Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kamy

macrumors member
Original poster
Jul 27, 2011
44
0
hey Mac Experts,

Am working on the new notification center for our app.
This works well for Mountain Lion.

I use the following code to ensure that notifications will only be triggered if the class exists.

Code:
 if (NSClassFromString(@"NSUserNotificationCenter") != nil)
  {
      //Only Mountain Lion and Above
      NSUserNotification *userNotification = [NSUserNotification new];
      userNotification.title = title;
      userNotification.subtitle = subtitle;
      userNotification.informativeText = message;
      userNotification.userInfo = options;
    
      NSUserNotificationCenter *center = [NSUserNotificationCenter  defaultUserNotificationCenter];
      center.delegate = self;
      [center scheduleNotification:userNotification];
  }

Now if i need to ensure that my executable will show notifications on LION and SnowLeopard, what are the best practises recommended?

I have set the Deployment target to 10.6
What do i do in the else part?

I could use GROWL SDK to provide notifications for LION, SL users.
But what if GROWL is not installed in the end user's system, then what are my options?

Can i display my notification as an Alert?
what are the best practises recommended?

Any responses will be appreciated.
thanx.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
The current Growl 2.0.1 SDK supports 10.6 thru 10.8 and will use the user notification center if it exists, otherwise it will use Growl if it is installed or Mist if not. Mist and the user notification center just don't have as many display or style options as Growl.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
You can embed the Growl framework into your app.

IIRC, the notification will still show up even if the Growl app/PrefPane isn't installed, the user just can't edit the theme and some other prefs.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.