Skip to content

Commit

Permalink
Xcode 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Sep 23, 2016
1 parent 8128941 commit 79df563
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -2,6 +2,8 @@

A plugin to make the screen not dim (and eventually lock the device).

> Note that version 1.2.0+ requires NativeScript 2.3.0+
## Installation
Run the following command from the root of your project:

Expand Down
6 changes: 4 additions & 2 deletions insomnia.ios.js
@@ -1,7 +1,9 @@
var utils = require("utils/utils");

exports.keepAwake = function () {
return new Promise(function (resolve, reject) {
try {
var app = UIApplication.sharedApplication();
var app = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
if (!app.idleTimerDisabled) {
app.idleTimerDisabled = true;
}
Expand All @@ -16,7 +18,7 @@ exports.keepAwake = function () {
exports.allowSleepAgain = function () {
return new Promise(function (resolve, reject) {
try {
var app = UIApplication.sharedApplication();
var app = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
if (app.idleTimerDisabled) {
app.idleTimerDisabled = false;
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,12 +1,12 @@
{
"name": "nativescript-insomnia",
"version": "1.1.1",
"version": "1.2.0",
"description": "Make the screen not dim (and eventually lock the device) while Insomnia is active",
"main": "insomnia.js",
"nativescript": {
"platforms": {
"ios": "1.1.0",
"android": "1.1.0"
"ios": "2.3.0",
"android": "2.3.0"
}
},
"repository": {
Expand Down

0 comments on commit 79df563

Please sign in to comment.