App is Killed push notification received acknowledgement to server

Hello everyone, My question is here how can I handle the delivery of message while the app is closed.
here can somebody discuss or provide solution in ionic capacitor 5. thanks in andvance

This is a good tutorial on Push Notifications - Push Notifications - Firebase | Capacitor Documentation

1 Like

@twestrick Thanks for your reply. yes but when the app is killed and I receive a notification here are two questions:

  1. Is there any possible way from firebase to get acknowledgement from device by default via firebase sdk configured ?
  2. Or how can I send a httpRequest to my server that i have received message ?
    Capacitor background runner is one possible way but sometimes OS kill the background task.

It is still not clear what you are trying to do. Push notifications are received even if the app is closed.

I want to send http Post request to server while I receive push notification and the app is closed

Use NotificationServiceExtension for iOS and for Android you need to extend FirebaseMessagingService and override onMessageReceived.

Note that onMessageReceived only works in background when using data notifications only and for NotificationServiceExtension to work you need to set content-mutable.

So you basically need program it natively.

1 Like

@digaus thanks for you response. it works :sunglasses: I have coded in native editors.