If you intend to update the badge count as a result of arriving push notifications, you should probably set its value in the server (using the badge
property of the push notification).
When your server sends push notifications to your app they are not guaranteed to arrive. If you send several notifications in a short time period, it's possible that Apple will deliver only some of them. Therefore it's not a good practice to increase the badge count in the app when a notification arrives.
Another reason why it's not a good practice is that if you update the badge programatically in the app, the update will take place only when the user taps the notification (and if the user opens the application via the launch icon, you wouldn't even know there was a notification, so you won't know to update the badge).
The idea of the badge is that the server sends it as part of the push notification. Then iOS displays the badge on the app icon even if you don't tap the notification. This tells the user he/she has new information to view in the app. When the app is launched, you should display the new data and clear the badge (by setting its value to 0).
Usually the badge number returned by the server contains the number of new data items available at the server for the user of the app (such as the number of unread emails). Letting the server maintain this number makes even more sense when the user can access the data from the server via multiple devices. If you read all your new emails on your laptop, you don't want your email app to show a badge number that indicates unread messages.