Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangkn/d060f6b1f498b024369268a2e830e2ad to your computer and use it in GitHub Desktop.
Save zhangkn/d060f6b1f498b024369268a2e830e2ad to your computer and use it in GitHub Desktop.
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