title: Apple push notification not changing icon badge automatically
body: <p>I have seen the mail app in my iPhone (4S, iOS 5.1) automatically updates the badge count if new mail arrives, even when app is not running. So it is possible to achieve this behavior in my app also, right?</p>
  
  <p>My application successfully registers for push notifications for all 3 types - Badge, Alert and Sound.
  Phone Settings is set ON for all 3 types of remote notifications for this application.</p>
  
  <p>My app receives remote notifications and shows alert, plays sound, but it <strong>does not</strong> update the badge number.
  If I launch the app via the View button on the alert, then my app can read the badge value perfectly and I can change/remove/set the icon badge from code.</p>
  
  <p>Any specific reason why iOS cannot change the icon badge of my app automatically when the notification arrives? I have seen all the similar posts, they are all discussing about either phone settings, or about notification types that it registered, or about checking the payload JSON includes badge or not.</p>
  
  <p>Is there any other reason that might cause this problem?</p>
  
  <p>Here is my code blocks:</p>
  
  <p>Register for APNs every time app is launched - </p>
  
  <pre><code>[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
  </code></pre>
  
  <p>Device token received almost instantly.
  Token has been sent to provider, and I am receiving notifications. Alerts and Sounds works. But badge has no automatic effect until I launch the app and change it manually. Please help.</p>