Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
if (err) {
const CFTypeRef keys[] = {
kCFUserNotificationAlertHeaderKey,
kCFUserNotificationAlertMessageKey,
kCFUserNotificationDefaultButtonTitleKey,
};
const CFTypeRef values[] = {
CFSTR("System files missing!"),
CFSTR("RocketBootstrap has detected that your SimulateCrash crash reporting daemon is missing or disabled.\nThis daemon is required for proper operation of packages that depend on RocketBootstrap."),
CFSTR("OK"),
};
CFDictionaryRef dict = CFDictionaryCreate(kCFAllocatorDefault, (const void **)keys, (const void **)values, sizeof(keys) / sizeof(*keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
SInt32 err = 0;
CFUserNotificationRef notification = CFUserNotificationCreate(kCFAllocatorDefault, 0.0, kCFUserNotificationPlainAlertLevel, &err, dict);
CFRunLoopSourceRef runLoopSource = CFUserNotificationCreateRunLoopSource(kCFAllocatorDefault, notification, SanityCheckNotificationCallback, 0);
CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, kCFRunLoopCommonModes);
CFRelease(dict);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment