Last active
August 14, 2018 21:04
-
-
Save CreatureSurvive/3a39da9e240b44ed66175750a2993211 to your computer and use it in GitHub Desktop.
Am I insane, or should one of these methods be working with NoctisXI
This file contains hidden or 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
| - (void)applicationDidFinishLaunching: (UIApplication *)application { | |
| %orig; | |
| NSLog(@"registering for noctis notifications"); | |
| NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; | |
| // with SEL callbacks | |
| [center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.enablenotification" object:nil]; | |
| [center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.disablenotification" object:nil]; | |
| // with block callbacks | |
| [center addObserverForName:@"com.laughingquoll.noctis.enablenotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { | |
| NSLog(@"notification received block [%@]", notification.description); | |
| }]; | |
| [center addObserverForName:@"com.laughingquoll.noctis.disablenotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification){ | |
| NSLog(@"notification received block [%@]", notification.description); | |
| }]; | |
| } | |
| %new - (void)__didRecieveNoctisNotification: (NSNotification *)notification { | |
| NSLog(@"notification received [%@]", notification.description); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment