question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

integration with phonegap-plugin-push when on background

See original GitHub issue

Hello, I would like to know if there is a way to change the badge number when the app has been closed or still runs at the background (for android).

push.on('notification', function(data) {
            console.log(data);
            if(!data.additionalData.foreground)
            {
                cordova.plugins.notification.badge.set(10);

            }
}

The above code doesn’t seem to trigger the badge.set function. I have tried to work with the phonegap-plugin-background-mode but I saw some people having issues with the Appstore, so I rejected that option. Could you guide me on how to do this? All I want is to be able to change the badge number when the app is not on the foreground. Regards

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
mlabarcacommented, Jun 7, 2016

In case anyone is following this, the phonegap-plugin-push just updated yesterday with code to set badges on android: https://github.com/phonegap/phonegap-plugin-push/blob/master/CHANGELOG.md

0reactions
parismav87commented, Jun 8, 2016

Thanks @mlabarca !

Read more comments on GitHub >

github_iconTop Results From Across the Web

i want to get the push notification in background #2301 - GitHub
Expected Behaviour i want to get the push notification in background or when the app is closed Actual Behaviour push notification shows only ......
Read more >
unable to integrate phonegap-plugin-push - Stack Overflow
I have done it for a phoneGap app, using this in config file for push notification plugin <plugin name="phonegap-plugin-push" spec="~1.10.5" ...
Read more >
Integrating Cordova Plugin - Pushwoosh
1. Install the Plugin source code into your app: · 2. Whitelist . · 3. Get the google-services. · 4. Add the following...
Read more >
Approved Plugins - VoltBuilder
Approved Plugins. These plugins can be used by VoltBuilder's Indy. Pro, and Enterprise plans. Need a plugin that isn't on the list? Let...
Read more >
Marketing Cloud Cordova Plugin Push Notification Issue
Do you know where can I apply some functions when I tap on push notification received (app run in background)? e.g. redirect to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found