Search code examples
xtify

How can I deduct the Badge Counter on iOS by one every time the user reads a Push Notification from the tray?


I'm using the Xtify plug in through Application Craft.

After looking at Xtify's help page: http://developer.xtify.com/display/sdk/PhoneGap+Cordova+for+iOS+Xtify+Integration+Guide

at the section: To Manage the Badge Count

I found a set of functions to control the Badge Number.

But it is not clear from these functions, how can I deduct the Badge Counter by one, after the user reads one of the received notifications. For the moment I can only completely clear all notifications from the Tray (and the Badge Counter disappears).

But if the user has received 4 unread notifications, the badge counter is set to 4. Then if the user reads one of these notifications, the badge counter is still stuck to "4". I want to simply reduce the counter by one and remove only that "read" notication from the tray and not ALL notifications.

Any help would be really appreciated.


Solution

  • There are set/get badge javascript methods that will set and get the native iOS badge counts. However, this will only work if the Xtify native objective C plugin class is included in the application craft platform and compiled with the application. The javascript functions interact with the underlying Xtify xCode/obj-c functions.

    That would be step 9-14 on this page: http://developer.xtify.com/display/sdk/PhoneGap+Cordova+for+iOS+Xtify+Integration+Guide

    Likely you will have to contact AC directly to support the Xtify native phonegap cordova plugin.