I'm working on a small wrapper for the Growl 1.3.1 SDK. More specifically, I'd like to package Growl in my application so that even if the user doesn't have Growl, they will still be able to get notifications. I previously had Growl installed and my code would fire a notification. I have since uninstalled Growl and am using just the framework; Mist, I believe it is called. However, when I launch the code now (that Growl is uninstalled), no notification is fired! Below is the code I am currently working with:
#import "growlwrapper.h"
void showGrowlMessage(std::string title, std::string desc) {
std::cout << "[Growl] showGrowlMessage() called." << std::endl;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[GrowlApplicationBridge setGrowlDelegate: @""];
[GrowlApplicationBridge
notifyWithTitle: [NSString stringWithUTF8String:title.c_str()]
description: [NSString stringWithUTF8String:desc.c_str()]
notificationName: @"Upload"
iconData: nil
priority: 0
isSticky: NO
clickContext: nil
];
[pool drain];
}
int main() {
showGrowlMessage("Hello World!", "This is a test of the growl system");
return 0;
}
I also have the appropriate Growl Registration dictionary, and am compiling with:
g++ growlwrapper.mm -framework Growl -framework Foundation -o growltest
Is there anything wrong with this code? Any ideas why it wouldn't be firing?
Edit: Seems the code above is working just fine. Just needed to be in a run loop, with the appropriate Growl dictionary stuff.