title: Can not remove push notification from notification center
body: <pre><code>[[UIApplication sharedApplication] cancelAllLocalNotifications];
  [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];'
  </code></pre>
  
  <p>I added the above code to <code>didfinishLaunchingWithOptions</code> but when a user taps a notification in his notification center and enters my app the notification does not gets cleared. </p>
  
  <p>Edit: </p>
  
  <p>I also tried adding this to my code:</p>
  
  <blockquote>
    <p>You Also need to increment then decrement the badge in your
    <code>application:didReceiveRemoteNotification:</code> method if you are trying
    to clear the message from the message centre so that when a user
    enters you app from pressing a notification the message centre will
    also clear, ie:</p>
  </blockquote>
  
  <pre><code>[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 1];
  [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];
  [[UIApplication sharedApplication] cancelAllLocalNotifications];  
  </code></pre>
  
  <p>as describes here: <a href="https://stackoverflow.com/questions/8682051/ios-application-how-to-clear-notifications">iOS application: how to clear notifications?</a> but the notification still won't clear from the notification center</p>