Closed TheNemus closed 2 years ago
When your app is backgrounded or closed the OS takes those fields to display the notification, but don't pass them to the app when the notification is tapped
@jcesarmobile actually, it doesn't work even with the app in foreground. Anyway, this should be noted in plugin documentation.
Is any other way to recover the notification data?
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 3.1.2 @capacitor/core: 3.1.2 @capacitor/android: 3.1.2 @capacitor/ios: 3.1.2
Installed Dependencies:
@capacitor/cli: 3.1.1 @capacitor/android: 3.1.1 @capacitor/ios: 3.1.2 @capacitor/core: 3.1.1
[success] iOS looking great! 👌 [success] Android looking great! 👌
Platform(s)
Android 8 (real device) Android 11 (simulator)
Current Behavior
After receiving a push notification, event pushNotificationReceived gives a pushNotificationSchema object: with 'title', 'body' and 'data' fields When I tap the notification, pushNotificationActionPerformed gives an ActionPerformed object whose notification fields miss all these fields, giving the app no chance to know what to do:
Expected Behavior
Having the notification object both from pushNotificationReceived event and pushNotificationActionPerformed event
Code Reproduction
Other Technical Details
This code perfectly works on iOS 14.5 (simulator)
npm --version
output: 6.13.4node --version
output: 12.14.1