phonegap-build / PushPlugin

This repository is deprecated head to phonegap/phonegap-push-plugin
https://github.com/phonegap/phonegap-plugin-push
MIT License
1.32k stars 997 forks source link

Badge counter not incremet in iOS #484

Open Neotrixsx opened 9 years ago

Neotrixsx commented 9 years ago

Hi all,

I am new in phonegap iOS Development, I use Pushplugin in my Application, Push Notification Working fine, But Badge counter is not incremental, its always fixed in 1.

In application I use latest PushPlugin 2.4.0 Link:- https://github.com/phonegap-build/PushPlugin

On server side, I used PHP. For badge I used code

// Create the payload body

    $cntmsg='1'; 
    $badges=(int)$cntmsg;
    $body['aps'] = array(
      'alert' => $message,
      'sound' => 'default',
      'badge' => $badges
    );

Please Help Me.

edvella commented 9 years ago

As far as I know, the message counter has to be calculated and sent by the server according to the value you want to set, not by how much you want to increment.

So you should have some kind of mechanism where the client warns the server if any previous messages were read, and the server should calculate the badge number accordingly.

Neotrixsx commented 9 years ago

Thanks for your reply. I have already informed that I am new in iOS development so please if you know the badge counter increment mechanism please help me.

ramyacl commented 8 years ago

How to increment the badge in client side while receiving notification?