How to use the On method of Background Mode plugin


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?



Like you would any other Observable.

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


Cool, first time I see one of those.


when i use this my app stop working