Issue
I'm developing a navigation app with Ionic framework. Is there a way to keep the screen of the device open while the app is up and running ?
Solution
Yes you can Keep screen Active: There is a cordova plugin for this:
ionic cordova plugin add cordova-plugin-insomnia
npm install @ionic-native/insomnia
import { Insomnia } from '@ionic-native/insomnia/ngx';
constructor(private insomnia: Insomnia) { }
...
this.insomnia.keepAwake()
.then(
() => console.log('success'),
() => console.log('error')
);
this.insomnia.allowSleepAgain()
.then(
() => console.log('success'),
() => console.log('error')
)
Check Plugin Docs here Cordova Insomnia Docs
Answered By - Najam Us Saqib
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.