cordova-plugin-firebasex
cordova-plugin-firebasex copied to clipboard
onMessageReceived not fires only on iOS cold start app
Bug report
CHECKLIST
-
[X] I have read the issue reporting guidelines
-
[X] I confirm this is a suspected bug or issue that will affect other users
-
[ ] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
-
[X] I have read the documentation thoroughly and it does not help solve my issue.
-
[X] I have checked that no similar issues (open or closed) already exist.
Current behavior:
On iOS devices (<any>window).FirebasePlugin.onMessageReceived
not fires when app is closed(cold start). If push comes with the app launched or in background the method fires correctly
Expected behavior:
(<any>window).FirebasePlugin.onMessageReceived
fires on iOS all conditions
Steps to reproduce:
- this.platform.ready()
2.(
window).FirebasePlugin.onMessageReceived
Send a push to app with the app closed. When taps into the notification the app is opened and not fires this method.
If: -App is opened in background mode the method fires correctly -App is opened in foreground mode the method fires correctly
Environment information
- Cordova CLI version 9.0.0
- Cordova platform version cordova-ios 6.1.1 / 6.2.0-dev
- Plugins & versions installed in project (including this plugin)
com.googlemaps.ios 3.8.0 "Google Maps SDK for iOS"
cordova-open-native-settings 1.5.2 "Native settings"
cordova-plugin-androidx 3.0.0 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-camera 5.0.1 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-firebasex 11.0.3-cli "Google Firebase Plugin"
cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 4.1.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-ios-disableshaketoedit 1.0.0 "iOS Disable Shake to Edit"
cordova-plugin-ios-localized-strings 1.0.6 "Cordova iOS Localized Strings"
cordova-plugin-network-information 2.0.2-dev "Network Information"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3-dev "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-sqlite-storage 5.1.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
es6-promise-plugin 4.2.2 "Promise"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
- Dev machine OS and version, e.g.
- OSX 11.0.1
Runtime issue
- Device details
- Real device iPhone X
- OS details
- iOS 14.2
Ionic version 5
Other information:
-The onMessageReceived is called on platform ready -On Android version all work fine.
Thanks for your time
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still a problem.
Push notifications sent to iOS devices for which the target app is completely closed do not fire off onMessageReceived()
.
If I re-send the notification after the app has been loaded and then backgrounded, it works as expected.
I've tried setting the APS payload of the FCM message packet but that doesn't appear to change the outcome at all. Any debugging I've added does not seem fire off, indicating that onMessageReceived()
is not called at all.
Edit: I'm creating a new ticket since I cannot re-open this issue.
Reopening as stalebot incorrectly closed it
I've found another weird behavior. After installing the app, and after the ios app asks for push notification permissions, onMessageReceived doesn't trigger.
It starts working only after you kill the app and then you reopen it (it subscribes to that observable on startup).
As if it can't receive any notification in the same session where the app request that permission... Is it solvable? Because i have a published app that has that behavior.
I've same error. Any solution for this problem?