Created
October 31, 2014 21:38
-
-
Save 0xjorgev/b7d7e9627db9018bd083 to your computer and use it in GitHub Desktop.
Parse.com PushNotification AppDelegate.m Updated for iOS 8
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 { | |
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