Created
May 14, 2018 08:03
-
-
Save zhangkn/d060f6b1f498b024369268a2e830e2ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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