Push Notifications not received when app is in background #851
Labels
Cloud Messaging
Related to Firebase FCM / Push Notifications / APNS
ios
relates to iOS platform
runtime issue
An issue related to app runtime
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: