0

I have used the google cloud messaging api and integrated it using php and curl method in my server side . I am receiving the notification messages too ,

But the problem is i am not able to increment the count of the notification. I know i have to keep a track of unread messages for each user in client side . But i dont know which parameter changes the notificaion count in the message array i am using ... please check the below array and tell me which parameter sends the notification count over the app icon . similar to badge parameter in ios push notification

     $msg = array (
            'message' => 'Test message from app', 
            'title' => 'This is a title. title',
            'vibrate' => 2,
            'sound' => 'beep.wav',
            'largeIcon' => 'large_icon',
            'smallIcon' => 'small_icon',
            'msgcnt'=>3
           );
  • `msgcnt` sets the count. See the plugin [code](https://github.com/phonegap-build/PushPlugin/blob/master/src/android/com/plugin/gcm/GCMIntentService.java#L120) and the docs for [setNumber](http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setNumber%28int%29) – Ajoy May 17 '15 at 09:07
  • Does that solve your problem? – Ajoy May 21 '15 at 03:49
  • no Ajoy , msgcnt actually sets the count in the notification bar only , i mean in that single comman page where every notification is displayed. – Prabhulal Ramesh May 25 '15 at 05:30
  • I want the msgcnt to be displayed on the app icon . , its always showing 1 and not incrementing. – Prabhulal Ramesh May 25 '15 at 05:30
  • I do not understand 'single comman page where every notification is displayed' – Ajoy May 25 '15 at 05:55
  • However, I think what you are trying is not possible in android. Read this [answer](http://stackoverflow.com/a/19183576/1761793). That is why PushPlugin does not have this feature. But you could make use of this [pull request](https://github.com/phonegap-build/PushPlugin/pull/181) to achieve something similar to what Gmail does. – Ajoy May 25 '15 at 06:00

0 Answers0