title: auto-increment badges number when receiving push notifications from APNS
body: <p>I would like to let the badge number increasing automatically when receiving push notifications, for example: if I receive two notifications let the number displays as 2, if I receive more, the number increases. And I want to let the number returns zero when I open the application. So what I am doing is the following:
  the code in application did finish launching</p>
  
  <p><code>[UIApplication sharedApplication].applicationIconBadgeNumber = 0;</code> </p>
  
  <p>otherwise, the code in did Receive Remote Notification is </p>
  
  <p><code>application.applicationIconBadgeNumber = [[apsInfo objectForKey:@"badge"] integerValue];</code></p>
  
  <p>In the server, in the php file: </p>
  
  <pre><code>$payload = '{"aps": {"alert":"'.$message.'", "sound":"default","badge":"+1"}}';
  </code></pre>
  
  <p>But, unfortunately, the number doesn't incremented, please correct me if the code above is wrong, thank you per advance.</p>