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