1
votes

I'm using push notifications in my ionic+phonegap-plugin-push app without problem.

Everything works fine BUT, once a day or so I get a blank notification, no message, nothing but the app icon and there is no way you can remove that notification from the "notification center".

It seems to happen only in android so I guess is related to the push plugin or maybe something related to the new firebase back, ionic, ...no idea seriously.

Any ideas? According to the logs in the server the payloads are the right ones and I'm not able to reproduce it.

I'm using:

  • cordova --version: 6.4.0
  • cordova platform version android: 5.1.1
  • cordova plugin version:
    • cordova-plugin-app-event 1.2.0 "Application Events"
    • cordova-plugin-background-fetch 4.0.0 "CDVBackgroundFetch"
    • cordova-plugin-background-mode 0.7.1 "BackgroundMode"
    • cordova-plugin-badge 0.7.4 "Badges"
    • cordova-plugin-camera 2.3.1 "Camera"
    • cordova-plugin-compat 1.1.0 "Compat"
    • cordova-plugin-console 1.0.5 "Console"
    • cordova-plugin-datepicker 0.9.2 "DatePicker"
    • cordova-plugin-device 1.1.4 "Device"
    • cordova-plugin-file 4.3.1 "File"
    • cordova-plugin-file-transfer 1.6.1 "File Transfer"
    • cordova-plugin-inappbrowser 1.6.1 "InAppBrowser"
    • cordova-plugin-network-information 1.3.1 "Network Information"
    • cordova-plugin-splashscreen 4.0.1 "Splashscreen"
    • cordova-plugin-statusbar 2.2.1 "StatusBar"
    • cordova-plugin-vibration 2.1.3 "Vibration"
    • cordova-plugin-whitelist 1.3.1 "Whitelist"
    • ionic-plugin-deploy 0.6.5 "IonicDeploy"
    • ionic-plugin-keyboard 2.2.1 "Keyboard"
    • phonegap-plugin-push 1.8.4 "PushPlugin"
1
Thanks for your comments. I guess you're pointing in the right direction with the plugins. I'm posting the found issue in a second plugin.Ivan Arrizabalaga
List of plugins makes question more answerableSelvin

1 Answers

1
votes

I thought it was a problem with the phonegap push plugin but it was not.

I was also using the cordova-plugin-background-mode which internally creates a local notification to wake up the app in the background.

My code configures the plugin with silent mode so it is supposed to create a local notification that doesnt show up anywhere.

        $ionicPlatform.ready(function () {
            cordova.plugins.backgroundMode.setDefaults({ silent: true });
            cordova.plugins.backgroundMode.enable();

            cordova.plugins.backgroundMode.onactivate = function () {
                //my own stuff here...
            };
        });

There is a closed issue that reflects this (https://github.com/katzer/cordova-plugin-background-mode/issues/89) and according to some comments and my own experience it is still happening.

Hope it helps.