-
-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push Notifications not received when app is in background #851
Comments
In my case the push notification only arrives when I am in the background, when I am inside the app it does not arrive. Does anyone know if it is a configuration issue that I am missing? |
Strange thing is I tried with: In all these cases I experienced same issue: notifications are not received when the app is closed... |
Here is a screen recording showing the test project built with the latest plugin version (v16.3.0) and @hal-berto I notice your test device is an Asus. |
Bug report
CHECKLIST
I have read the issue reporting guidelines
I confirm this is a suspected bug or issue that will affect other users
Current behavior:
Notification messages are received only when app is in foreground. If the app is in background or is closed, notifications are no more received.
Expected behavior:
Notifications should be received even if the app is in background or is closed
Environment information
cordova-plugin-advanced-http 3.3.1 "Advanced HTTP plugin"
cordova-plugin-device 2.1.0 "Device"
cordova-plugin-file 7.0.0 "File"
cordova-plugin-firebasex 16.2.0 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-x-socialsharing 6.0.4 "SocialSharing"
cordova.plugin.autostart.permission 0.0.1 "AutoStartPermission"
es6-promise-plugin 4.2.2 "Promise"
Runtime issue
Related code:
In app.component.ts following code is executed in function ngOnInit():
The code in this.firebase.grantPermission() is ignored, no permission is requested and no logs are written in console (but it should be correct, at least if I correctly understood what's written in the documentation about plugin usage under Android).
I also tried to add following configuration in config.xml file:
With this configuration when application is executed on recent phones (android 13+) a message appears asking to give permission to receive notifications, but nothing changes. Even with permission granted, no notification is received when app is in background.
Other information:
This issue seems to be present in recent versions of cordova platform. In apps developed with older versions of cordova (for example cordova 6.3.0) notifications are received.
The text was updated successfully, but these errors were encountered: