Capacitor Push notification click


I have an aplication with capacitor push notification. I have configured that alert should show. Everything works except - when I am running application (it is foreground) and push notification show default alert, there is no action after alert click.

When the app is in background, listener pushNotificationActionPerformed is proceed. Is there something similar for click on push if the app is in foreground?


I don’t remember where I read it, but I don’t think pushNotificationActionPerformed is supported in the foreground.

In my app, under the listener pushNotificationReceived, I create a local notification from the push notification. Then under the local notification localNotificationActionPerformed listener, I handle the tap logic.

Great solution, thanks. But one question - if I create local notification and the app is in foreground, local notification is only in notification area and in the app there is no alert showed. Should I add something else?


For Android at least, you might need to set the importance on your channel to 4.

Higher notification importance: shows everywhere, makes noise and peeks. May use full screen intents. (Source)