How to use the On method of Background Mode plugin


#1

Hi
I am trying to figure out how to use Background Mode plugin.
I think I got the idea of enable and disable methods but how do I use the on method?
I believe this is the plugin interface for me to realise that my app just moved to background right?

Thanks.


#2

Like you would any other Observable.

bgmode.on('enable').subscribe(() => {
  // i got enabled
});

#3

Cool, first time I see one of those.
Thanks.


#4

when i use this my app stop working