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 thi
I had a similar problem, solved it by forcing integer in the badge number (using PHP with data coming from MySQL db):
$body['aps'] = array(
'alert' => array(
'action-loc-key'=> utf8_encode($r['button_action']),
'body' => utf8_encode($r['message']),
'launch-image' => ''
),
'badge' => (int)$r['badge_number'],
'sound' => 'default'
);
Ps.: take a look at the utf8_encode
command to avoid a json_encode
error I faced earlier too.