Call function when app is closed


#1

I need help, I do not know how to make a function call in the background when the application is closed, it only works if it is open or minimized.

    platform.ready().then(() => { 
      this.backgroundMode.setDefaults({ silent: true });
      this.backgroundMode.enable();
      backgroundMode.on('enable').subscribe(() => { 
        setInterval(() => {
          this.getBusqueda();
        }, 5000);
      }); 

#2

When your app is closed, that means that the user does not want it eating their battery. Would you please respect that?


#3

The function I want to run in the background, is simply a function that checks whether a notification should arrive and displays it.


#4

same problem here, for push notification with onesignal