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
@twestrick Thanks for your reply. yes but when the app is killed and I receive a notification here are two questions:
- Is there any possible way from firebase to get acknowledgement from device by default via firebase sdk configured ?
- 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.https://capacitorjs.com/docs/apis/background-runner#capacitor-api
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.
@digaus thanks for you response. it works I have coded in native editors.