title: ios7.1: push notification badge update issue
body: <p>I have setup <code>Push Notification</code> in One of my current Project. I have followed all instruction required for Push notification. that working fine in [tag: ios7]  but in <code>7.1</code> i got issue in badge update when my application in background Mode.</p>
  
  <p><strong>My code is Following:-</strong></p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
   [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
       (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
  
  }
  
  
  - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
  {
      NSLog(@"Failed to get token, error: %@", error);
  }
  
  
  - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  {
      NSString *str = [NSString
                       stringWithFormat:@"%@",deviceToken];
      NSLog(@"%@",str);
  
      self.deviceToken = [NSString stringWithFormat:@"%@",str];
      NSLog(@"dev --- %@",self.deviceToken);
      self.deviceToken = [self.deviceToken stringByReplacingOccurrencesOfString:@"&lt;" withString:@""];
      self.deviceToken = [self.deviceToken stringByReplacingOccurrencesOfString:@" " withString:@""];
      self.deviceToken = [self.deviceToken stringByReplacingOccurrencesOfString:@"&gt;" withString:@""];
      NSLog(@"dev --- %@",self.deviceToken);
  }
  </code></pre>
  
  <p><strong>And for getting responce</strong></p>
  
  <pre><code>-(void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
  {
  
      UIApplicationState state = [application applicationState];
  
      // If your app is running
      if (state == UIApplicationStateActive)
      {
  
          //You need to customize your alert by yourself for this situation. For ex,
          NSString *cancelTitle = @"ok";
        //  NSString *showTitle = @"Get Photos";
          NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"];
          UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@""
                                                              message:message
                                                             delegate:self
                                                    cancelButtonTitle:cancelTitle
                                                    otherButtonTitles:nil];
          [alertView show];
  
  
      }
      // If your app was in in active state
      else if (state == UIApplicationStateInactive)
      {
  
      }
  
       [UIApplication sharedApplication].applicationIconBadgeNumber = [UIApplication sharedApplication].applicationIconBadgeNumber + [[[userInfo objectForKey:@"aps"] objectForKey: @"badge"] intValue];
  
  }
  </code></pre>
  
  <p>First thing is that when my Application going to back ground that <code>didReceiveRemoteNotification</code> not getting called so i did some search and put:-</p>
  
  <pre><code>- (void)application:(UIApplication *)application
  didReceiveRemoteNotification:(NSDictionary *)userInfo
  fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
  </code></pre>
  
  <p>And set Background Mode like:-</p>
  
  <p><img src="https://i.stack.imgur.com/EjG5P.png" alt="enter image description here"></p>
  
  <p>That All working fine when my device is connect with xcode and i running the app testing Push Notification But when i unplugged device( iOS7.1). then push notification arrived but badge not update. Otherwise that badge update in background as well as all method called. But same thing i testing this app in to my another device with <code>iOS7</code> that working all well. </p>
  
  <p>I can't understand where is my mistake and where i did wrong in code. is there any bug or what i dont think so please help me out on this.</p>