Notifications not received when app closed - phonegap-plugin-push


#1

Hi,

I’m using phonegap-plugin-push@1.11.1 (with @ionic-native/push@4.0.1) and am not always getting notifications when the app is closed.

If I build and deploy a version to our test app, we get the notifications in the tray when the app is either in the background or closed. If I only change the widget id and the name (literally nothing else) and then build our production app we only get the notifications in the tray when the app is running in the background. If the app is closed we get no notifications.

Anyone out there got an idea or advice of what the issue might be?

If I can’t resolve I’ll have to upgrade to 2.x of the plugin and hope for the best but that obviously involves some rework on the server side also and I’m hoping it’s just something obvious, to someone out there…

Thanks in advance,
Alex

$ cordova -v

You have been opted out of telemetry. To change this, run: cordova telemetry on.
7.1.0

$ ionic info

cli packages: (C:\projects\personal\Salve\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : not installed

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.3.0 browser 4.1.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.3
    npm               : 5.4.2
    OS                : Windows 7


#2

same problem here . although i dont know the correct way but what i did was .
i installed background mode plugin .
using that exclude App from taskbar list
and also register back button and then minimize that app so in the background app will continue running
it worked for me but if os clears the app from memory it will not receive any notification


#3

Add your server code you may send the data in wrong way.
This is the correct way:

{
  "data": {
    "title": "Test Notification",
    "body": "This offer expires at 11:30 or whatever",
    "notId": 10,
    "surveyID": "ewtawgreg-gragrag-rgarhthgbad"
  }
}