Skip to content

Instantly share code, notes, and snippets.

@Kevinwlee
Created March 27, 2014 16:15
Show Gist options
  • Save Kevinwlee/9811343 to your computer and use it in GitHub Desktop.
Save Kevinwlee/9811343 to your computer and use it in GitHub Desktop.
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//Register your app
[ContextHub registerWithAppId:@"823b8648-YOUR-UUID-a653-748d4fff9128"];
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound ];
return YES;
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
NSLog(@"Did fail to register %@", error);
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
CCHNotificationService *sharedService = [CCHNotificationService sharedService];
[sharedService registerDeviceToken:deviceToken withCompletion:^(NSError *error) {
if(error) {
NSLog(@"%@", error);
} else {
NSLog(@"Success :)");
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment