Hello,
I have a background daemon which is launched by launchd at system startup. I need to show a notification window to reports some event occationally. My snippet is as follows.
CFStringRef message = CFStringCreateWithCString(NULL, filePath, kCFStringEncodingUTF8);
CFUserNotificationDisplayNotice( 3.0f, kCFUserNotificationStopAlertLevel | kCFUserNotificationNoDefaultButtonFlag,
NULL, NULL, NULL,
CFSTR("alert"),
message,
NULL);
CFRelease(message);
The CFUserNotificationDisplayNotice returns 0, but no window shows up.
I cannot find much information about how to use this API.
Could anybody show me the correct way to show some UI from a daemon? Thanks!