How can we run the background services even if the app is closed/killed by user

Im trying to get a notification from the server side to the app side. So server sends a notification at a specified time and if user closes or kills the app, how can we make sure the background services are not killed so the app can still get the notification.

Please help me out on this…

So if you are using push notifications (like FCM - https://ionicframework.com/docs/native/fcm) your app will use Devices native push notification functionality to allow registered “listener” of your app to receive messages and then act on them if user clicks it. Basically you app may not run in background but push notification for your app can still be delivered (background mode). If you app is active it also receives the message but then its called foreground message.

On OS like iOS apps are generally restricting to do something in background unless its a permitted activity (like geolocation etc). But since that drains battery as well - ideally you app should just be loaded after user clicks a notification.

1 Like

OK, if i’m using FMC native plugin and add listener’s then how does the server come to know about those listener’s who are registered. So even if app is not running FMC native plugin can get the notification sent from the server end???

Can you explain a little bit on registering the listeners and how can I achieve the interaction from server to the app.

Thanks.