I’m trying to display Push Notifications in one of my apps, It’s the first time that I doing this and I’m a little bit confusing about background-mode and push notifications dependency.
My apps will need to display different notifications according to their topics and I’m using Firebase.
I saw a thousand of examples which devs doesn’t use background-mode to display Push Notifications even when the app is in the background, so is necessary using background-mode or not?
While the Ionic UI runs in the context of a web view, cordova plugins do not. PushPlugin is a cordova plugin and is implemented in native code. Ergo, whatever rules apply to how the target OS handles push notifications applies here. Its easiest to write code to test it out.
That being said, my interpretation of the OPs question was “does the app always need to run in the background for remote push notifications to be delivered to the device and/or app”. The answer to that question is no for device, and generally not for the app.
There are two aspects to remote notifications:
a) Does the OS receive it ? (so it can show in the notification tray/center) - it does, whether the app is running or not. When an app is removed, the registration is deleted, so the OS does not receive it
b) Does the app receive it ? Depends on whether you force killed it or not