I am using this code. Every thing is working fine when push notification comes but badge number does not increase when application is in background. How to solve this problem? <
When you send a Push Notification you need add badge value. So you need handle badge for each user device. In php is something like that:
$body['aps'] = array( 'alert' => $message, 'sound' => 'default', 'badge'=> 10 );
where 10 thats just the number displayed in the icon.