File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 22
33A plugin to make the screen not dim (and eventually lock the device).
44
5+ > Note that version 1.2.0+ requires NativeScript 2.3.0+
6+
57## Installation
68Run the following command from the root of your project:
79
Original file line number Diff line number Diff line change 1+ var utils = require ( "utils/utils" ) ;
2+
13exports . keepAwake = function ( ) {
24 return new Promise ( function ( resolve , reject ) {
35 try {
4- var app = UIApplication . sharedApplication ( ) ;
6+ var app = utils . ios . getter ( UIApplication , UIApplication . sharedApplication ) ;
57 if ( ! app . idleTimerDisabled ) {
68 app . idleTimerDisabled = true ;
79 }
@@ -16,7 +18,7 @@ exports.keepAwake = function () {
1618exports . allowSleepAgain = function ( ) {
1719 return new Promise ( function ( resolve , reject ) {
1820 try {
19- var app = UIApplication . sharedApplication ( ) ;
21+ var app = utils . ios . getter ( UIApplication , UIApplication . sharedApplication ) ;
2022 if ( app . idleTimerDisabled ) {
2123 app . idleTimerDisabled = false ;
2224 }
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-insomnia" ,
3- "version" : " 1.1.1 " ,
3+ "version" : " 1.2.0 " ,
44 "description" : " Make the screen not dim (and eventually lock the device) while Insomnia is active" ,
55 "main" : " insomnia.js" ,
66 "nativescript" : {
77 "platforms" : {
8- "ios" : " 1.1 .0" ,
9- "android" : " 1.1 .0"
8+ "ios" : " 2.3 .0" ,
9+ "android" : " 2.3 .0"
1010 }
1111 },
1212 "repository" : {
You can’t perform that action at this time.
0 commit comments