Plugin BackgroundMode dont work: Object(...) is not a function

I need to run the code “this.backgroundMode.enable()” in my project, but it shows me the following error:


It imports it in app.module.ts in the following way:

import {BackgroundMode} from '@ ionic-native / background-mode / ngx';
providers: [

And in the page (in my case is in app.component.ts, after deviceready, like the official documentation says) i use like:

import {BackgroundMode} from '@ ionic-native / background-mode / ngx';
constructor(private backgroundMode: BackgroundMode) { }

Please I need to run this plugin in my project, can you help me?

1 Like

are there spaces in the path? ‘@ ionic-native / background-mode / ngx’

Late regards, anna-liebt

Hello @anna_liebt, there is no space in the path.

I following this StackOverlow link to solution my problem: