Ionic 2 Plugin not installed

Hi everyone,
I’m using the plugin background mode but i have error “Plugin not installed” when i try to get boolean value from BackgroundMode.isEnabled() function.
My steps:
1/ "ionic plugin add cordova-plugin-background-mode"
2/ import {BackgroundMode} from ‘ionic-native’;
3/ Run app on ios by ionic view
My code:
BackgroundMode.enable();
BackgroundMode.isEnabled().then((data) =>{alert(data);},(error)=>{alert(error)});

Somebody can help me ? thanks

Are you waiting for ondeviceready to fire?

If you’re running your app in Ionic View, background mode won’t work here.

View has a limited list of supported plugins (security reasons) and background mode isn’t supported.

1 Like

@mhartington : thanks men :slight_smile: