Skip to content

Instantly share code, notes, and snippets.

@0xjorgev
Created October 31, 2014 21:38
Show Gist options
  • Save 0xjorgev/b7d7e9627db9018bd083 to your computer and use it in GitHub Desktop.
Save 0xjorgev/b7d7e9627db9018bd083 to your computer and use it in GitHub Desktop.
Parse.com PushNotification AppDelegate.m Updated for iOS 8
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// ****************************************************************************
// Uncomment and fill in with your Parse credentials:
[Parse setApplicationId:@"YOUR-CLIENT-KEY" clientKey:@"YOUR-APP-KEY"];
// ****************************************************************************
// Override point for customization after application launch.
//This won't work for iOS 8 or Superior
// [application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[application registerForRemoteNotifications];
}
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window makeKeyAndVisible];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment