Skip to content

Commit 79df563

Browse files
Xcode 8 compatibility
1 parent 8128941 commit 79df563

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A 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
68
Run the following command from the root of your project:
79

insomnia.ios.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
var utils = require("utils/utils");
2+
13
exports.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 () {
1618
exports.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
}

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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": {

0 commit comments

Comments
 (0)