1

I'm using the "Push" plugin for my Phonegap app. The app is compiled through Phonegap Build, so I never actually use XCode. I specify I want the plugin by putting this in my config.xml:

<gap:plugin name="com.phonegap.plugins.pushplugin" version="2.1.1" />

I'm able to set the badge when I push a notification server side; however, when the app on the phone is opened, the badge is cleared. I would like to control when the badge is cleared manually. Does using this plugin via Phonegap Build force this behavior?

TaylorOtwell
  • 7,177
  • 7
  • 32
  • 42
  • See this post: http://stackoverflow.com/questions/24601874/phonegap-pushplugin-reset-badge-after-opening-app – SeanStL Dec 11 '15 at 17:02

2 Answers2

1

It's intended behaviour of the pushplugin plugin. You've to modify the Objective-C code.

Here is the full answer: Phonegap PushPlugin reset badge after opening app

0

The new API for this plugin allows you to specify this preference at initialisation:

var push = PushNotification.init({
  ios: {
    badge: true,
    clearBadge: false
  }
});
Ade
  • 2,961
  • 4
  • 30
  • 47