Closed Sebxx closed 4 years ago
On Android there are two types of notification payloads, data and notification.
If you use notification payload the notification is displayed when the app is in the background and if the app is fully closed, that's handled by the OS, not by Capacitor, then when you tap it pushNotificationActionPerformed
is called. If the app is in foreground then pushNotificationReceived
is called.
If you use data payload, the notification is not displayed on any app state, pushNotificationReceived
is called on background and foreground, but not when fully closed (used to work, but it's broken now, known and reported issue), pushNotificationActionPerformed
is never called.
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
npx cap doctor
output:Affected Platform(s)
Current Behavior
I am using the Capacitor's PushNotification plugin to register tokens and listen the notifications. The FCM and APNS tokens are registered directly to AWS SNS service. I'm sending custom and general notifications using the Node AWS SDK. In iOS I can get both the notification when the app is opened (in which I perform an alert) and when the app is killed (OS notifications tray). But in Android I can only get the notification when the app is opened. I can't get the
pushNotificationActionPerformed
event when the app is inactive or killed because the notification is not being shown in the notifications tray.Expected Behavior
Get the notification by the OS in the notifications tray in Android as I can get the payload when the application is in opened status.
Sample Code or Sample Application Repo
Reproduction Steps
Send an automatically notification when an administrative user performs an action. Then, the notification is shown only if the user has opened the application.
Other Technical Details
npm --version
output:6.14.5
node --version
output:v12.14.0
pod --version
output (iOS issues only):Other Information