Skip to content

Commit f6b4d17

Browse files
committed
Resolves #825 - Keep screen always on
1 parent 140db68 commit f6b4d17

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

IsraelHiking.Web/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</host>
5454
</universal-links>
5555
<plugin name="cordova-plugin-deeplinks" spec="^1.1.0" />
56+
<plugin name="cordova-plugin-insomnia" spec="^4.3.0" />
5657
<engine name="android" spec="^7.0.0" />
5758
<engine name="browser" spec="^5.0.4" />
5859
</widget>

IsraelHiking.Web/package-lock.json

Lines changed: 26 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IsraelHiking.Web/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"dependencies": {
3+
"@angular-redux/store": "9.0.0",
34
"@angular/animations": "6.1.6",
45
"@angular/cdk": "6.4.7",
56
"@angular/common": "6.1.6",
@@ -13,7 +14,6 @@
1314
"@angular/platform-browser-dynamic": "6.1.6",
1415
"@angular/platform-server": "6.1.6",
1516
"@angular/router": "6.1.6",
16-
"@angular-redux/store": "9.0.0",
1717
"@beyerleinf/ngx-dnd": "6.0.0-preview3",
1818
"@ngx-progressbar/core": "5.0.1",
1919
"@ngx-progressbar/http": "5.0.1",
@@ -26,6 +26,7 @@
2626
"cordova-plugin-deeplinks": "^1.1.0",
2727
"cordova-plugin-file": "^6.0.1",
2828
"cordova-plugin-inappbrowser": "^3.0.0",
29+
"cordova-plugin-insomnia": "^4.3.0",
2930
"cordova-plugin-mauron85-background-geolocation": "^3.0.0-alpha.40",
3031
"cordova-plugin-whitelist": "^1.3.3",
3132
"cordova-plugin-x-toast": "^2.7.0",
@@ -119,12 +120,13 @@
119120
"cordova-plugin-file": {},
120121
"cordova-plugin-x-toast": {},
121122
"cordova-plugin-camera": {},
122-
"cordova-plugin-deeplinks": {}
123+
"cordova-plugin-deeplinks": {},
124+
"cordova-plugin-insomnia": {}
123125
},
124126
"platforms": [
125127
"android",
126128
"browser"
127129
]
128130
},
129131
"version": "7.2.0"
130-
}
132+
}

IsraelHiking.Web/sources/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if (environment.production) {
1818
if (environment.isCordova) {
1919
let onDeviceReady = () => {
2020
window.open = cordova.InAppBrowser.open;
21+
(window as any).plugins.insomnia.keepAwake();
2122
bootstrapInitializationFunction();
2223
let exitApp = false;
2324
let interval = setInterval(() => { exitApp = false; }, 5000);
@@ -36,6 +37,7 @@ if (environment.isCordova) {
3637
}, false);
3738
};
3839
document.addEventListener("deviceready", onDeviceReady, false);
40+
document.addEventListener("resume", () => (window as any).plugins.insomnia.keepAwake(), false);
3941
} else {
4042
bootstrapInitializationFunction();
4143
}

0 commit comments

Comments
 (0)