-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
onMessageReceived doesn't get triggered after cold start #917
Comments
I can confirm we are seeing the same thing after updating to the latest. iOS only. Both in Simulator and actual device |
@dpa99c I'm also facing same issue on ios devices |
I can see it also @dpa99c it looks like the issue came with the introduction of the code regarding not delivering the push payload immediately. |
@nivlempert1 Do you see the issue only when starting the app by clicking the notification icon? What if you normally start the app? onMessageReceived should trigger the moment you call it. |
I see it when starting the app by tapping on the push notification. |
I was unable to replicate the problem. All pending notifications are being sent to the |
@ochakov are you checking onMessageReceived of the WebView? I have a video here where I am registering a callback right when the device is ready and it is not firing. I am noticing that the log printed by the plugin regarding didReceiveNotificationResponse is showing up, the the console log from my callback is not (I have FIREBASE_MESSAGING_IMMEDIATE_PAYLOAD_DELIVERY set to false): |
I've managed to fix this by adding
as part of the condition in the method
Also, not sure why are you call this one twice on
once inside the "try" block and then again outside it. |
@pitAlex If you believe your solution is appropriate, I’d appreciate it if you could share it with us in a PR |
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:
happens on iOS-
Quit the app
Send a notification
Press on the notification to open the app
onMessageReceived doesn't trigger- so the notification data is lost
I've read the documentation regarding the changes and I still can't make that case work. I tried both true and false for FIREBASE_MESSAGING_IMMEDIATE_PAYLOAD_DELIVERY
Tried both versions 17.0.0 and 18.0.0, it worked well on 17.0.0, and didn't on 18.0.0. I saw a lot of changes regarding notifications in 18.0.0
Expected behavior:
Quit the app
Send a notification
Press on the notification to open the app
onMessageReceived should trigger and then I can use the notification's data to further direct the user.
Environment information
Cordova CLI version - 12.0.0
Cordova platform version - 7.1.1
Plugins & versions installed in project (including this plugin)
@moodlehq/cordova-plugin-local-notification 0.9.0-moodle.12 "LocalNotification"
com.darktalker.cordova.screenshot 0.1.5 "Screenshot"
cordova-clipboard 1.3.0 "Clipboard"
cordova-launch-review 4.1.1 "Launch Review"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 3.0.0 "cordova-plugin-androidx"
cordova-plugin-app-version 0.1.14 "AppVersion"
cordova-plugin-badge 0.8.9 "Badge"
cordova-plugin-deeplinks 1.1.1 "Cordova Deeplinks Plugin"
cordova-plugin-device 2.1.0 "Device"
cordova-plugin-file-transfer 2.0.1-dev "File Transfer"
cordova-plugin-file 8.1.3 "File"
cordova-plugin-firebasex 17.0.0 "Google Firebase Plugin"
cordova-plugin-fullscreen 1.3.0 "cordova-plugin-fullscreen"
cordova-plugin-inappbrowser 6.0.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-localization-strings 5.0.5 "Localization"
cordova-plugin-navigationbar-color 0.0.8 "NavigationBar"
cordova-plugin-purchase 13.11.1 "Purchase"
cordova-plugin-statusbar 4.0.0 "StatusBar"
cordova-plugin-tts-advanced 0.5.2 "TTS"
cordova-plugin-x-socialsharing 6.0.4 "SocialSharing"
cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill"
cordova-sqlite-storage 6.1.0 "Cordova SQLite storage plugin - cordova-sqlite-storage plugin version"
es6-promise-plugin 4.2.2 "Promise"
Dev machine OS and version, e.g.
Runtime issue
The text was updated successfully, but these errors were encountered: