Page 1 of 1

Help: Getting started with Growl integration (Carbon)

Posted: Sun Jun 01, 2008 1:29 pm
by cfranz
We are currently trying to integrate Growl support into an app we are developing. The app is carbon-based, and to get our feet wet, I decided to write a minimal app that posts carbon bridge based notifications. Try as I might, though, I can't get it to work. I've tried on a 10.4 based PPC as well as a 10.5 based Intel. No dice. From what I can see, I must be missing something. Here's what I did:

1. create the ticket file for auto-discovery (with the dict tool from the source). it appears to be corretly discovered, because when the app launches, it is entered correctly into the Growl pref pane

2. Added the following code to the app initialization before calling app.run:

// some growl specific tests
sizer = sizeof(Growl_Delegate); // make sure we know the size of this struct. returns 56

// check to see if growl exists
hasGrowl = Growl_LaunchIfInstalled(callWhenGrowlLaunched, NULL);
hasGrowl = Growl_IsRunning();

InitGrowlDelegate(&delegate); // program uses Growl Registration Ticket in bundle to fill in most fields and to define notification names
delegate.applicationName = CFSTR("growltest"); // required, or SetDelegates returns FALSE
hasGrowl = Growl_SetDelegate(&delegate);


Obervation:
- callback is not called, but LaunchIfInstalled returns TRUE
- returns false if no app name is given

3. In the carbon event handler I call
Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( CFSTR("Growl From C"),
CFSTR("The C code has successfully executed a call to Growl"),
CFSTR("Connect"),
NULL, // icon
0, // no priority
true, // sticky
NULL // no context
);

Note: "Connect" is the only Notification that is registred with the dict
Observation: No notification is posted.
Using newest download of bridge, with installer, linked & copied to bundle
App is compiled for Deployment (release)

Growl Pref Pane has enabled all Growl calls for this app

Here's the Dict contents as a test file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllNotifications</key>
<array>
<string>Connect</string>
</array>
<key>ApplicationName</key>
<string>growl test (with blank)</string>
<key>DefaultNotifications</key>
<array>
<string>Connect</string>
</array>
<key>HumanReadableNames</key>
<dict/>
<key>NotificationDescriptions</key>
<dict/>
<key>TicketVersion</key>
<integer>1</integer>
</dict>
</plist>

What am I missing? Any takers? Or is Carbon just dead?

-ch

Re: Help: Getting started with Growl integration (Carbon)

Posted: Mon Jun 02, 2008 6:12 pm
by The_Tick
You might do better to mail the discuss list for this one.