title: Token For pushnotification ios8 vs ios7 phonegap
body: <p>Im using the following code lines for getting token for push notification,</p>
  
  <p>i added the next lines for supported in ios8, but when these lines are added the ipa works on ios8 but not on ios7 on ios7 the application is closed immediately after i open it.</p>
  
  <pre><code>- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
  {
  
  #ifdef __IPHONE_8_0
      //Right, that is the point
      UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge
                                                                                           |UIRemoteNotificationTypeSound
                                                                                           |UIRemoteNotificationTypeAlert) categories:nil];
      [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
  #else
      //register to receive notifications
      UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes];
  #endif
  
  #ifdef __IPHONE_8_0
  - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
  {
      //register to receive notifications
      [application registerForRemoteNotifications];
  }
  
  - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
  {
      //handle the actions
      if ([identifier isEqualToString:@"declineAction"]){
      }
      else if ([identifier isEqualToString:@"answerAction"]){
      }
  }
  #endif
  </code></pre>