Created
July 25, 2009 20:33
-
-
Save markbates/154957 to your computer and use it in GitHub Desktop.
Revisions
-
markbates created this gist
Jul 25, 2009 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; } // Delegation methods - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken { Device *device = [[Device alloc] init]; device.token = [devToken description]; [device saveRemote]; if ([device getRemoteId] != nil) { NSLog(@"success!"); } } - (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err { NSLog(@"Error in registration. Error: %@", err); }