fix document

This commit is contained in:
zhangqinghe 2014-09-24 20:33:55 +08:00
parent b1e00baeb8
commit 9536989082

View File

@ -52,11 +52,28 @@
self.window.backgroundColor = [UIColor whiteColor]; self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
// Required // Required
[APService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
UIRemoteNotificationTypeSound |    if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
UIRemoteNotificationTypeAlert)];     //可以添加自定义categories
// Required     [APService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
[APService setupWithOption:launchOptions];                                                    UIUserNotificationTypeSound |
                                                   UIUserNotificationTypeAlert)
                                       categories:nil];
  } else {
    //categories 必须为nil
    [APService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                   UIRemoteNotificationTypeSound |
                                                   UIRemoteNotificationTypeAlert)
                                       categories:nil];
#else
    //categories 必须为nil
  [APService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
                                                 UIRemoteNotificationTypeSound |
                                                 UIRemoteNotificationTypeAlert)
                                     categories:nil];
#endif
    // Required
    [APService setupWithOption:launchOptions];
return YES; return YES;
} }
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {