Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 25, 2013, 06:59 AM   #1
kamy
macrumors member
 
Join Date: Jul 2011
Notifications for LION and SnowLeopard

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.
kamy is offline   0 Reply With Quote
Old Mar 25, 2013, 09:20 AM   #2
Red Menace
macrumors 6502
 
Join Date: May 2011
Location: Littleton, 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.
__________________
MacBook Pro / OS X Yosemite (10.10) / Xcode 6.1 / RubyMotion FTW
Red Menace is offline   0 Reply With Quote
Old Mar 31, 2013, 03:12 PM   #3
Madd the Sane
macrumors 6502
 
Join Date: Nov 2010
Location: 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.
Madd the Sane is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Macbook ebay - Installation Problem Lion/SnowLeopard sambo.01 OS X 3 Jan 30, 2013 11:18 AM
Downgrading from Lion to Snowleopard easy? Beliblis Mac OS X 10.7 Lion 8 Nov 29, 2012 08:11 AM
Notifications....mountain lion saladiro Mac Applications and Mac App Store 0 Oct 10, 2012 08:04 PM
HTML5 Safari Notifications Mountain Lion Nathan20 OS X 10.8 Mountain Lion 0 Jul 26, 2012 08:14 AM
Notifications in OSX Mountain Lion J.SULLIVAN OS X 10.8 Mountain Lion 1 Jun 24, 2012 09:00 AM

Forum Jump

All times are GMT -5. The time now is 08:44 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC