Created
March 27, 2014 16:15
-
-
Save Kevinwlee/9811343 to your computer and use it in GitHub Desktop.
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
- (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