Detect when app goes to background using background-mode

Hello everyone,

I’m using the ionic-native background-mode to keep my app functioning in the background.
I want my app to show an notification when it goes to the background, and I should be able to use

this.backgroundMode.on('active', function(){

But i’m wondering where I should place this code. It should actually function like a sort of a angular1 watch equivalent…

It should actually exactly work like this:

But then using as much ionic-native components as possible.

Any help is appreciated :wink:

1 Like