Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LisaActions(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
- // Get notification name
- NSString *notifName = (__bridge NSString*)name;
- if([notifName isEqualToString:@"com.apple.springboard.lockstate"])
- // Track if locked or unlocked
- lock = !lock;
- //do something
- }
- %ctor {
- // CODE
- CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
- NULL,
- LisaActions,
- CFSTR("com.apple.springboard.lockstate"),
- NULL,
- CFNotificationSuspensionBehaviorDeliverImmediately);
- // CODE
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement