My question is, is there a way for the ionic application to determine if the device’s screen is locked / disabled? I know that an application can detect when it becomes “paused” and runs in the background, but that’s not what I mean. The reason for this is because I want to create a geolocation function that only works when the device screen is unlocked. Thanks
you can use ionic events pause resumesee this snippet
pause
resume
.run(function($ionicPlatform) { $ionicPlatform.on("resume", function() { // do something update your interval } $ionicPlatform.on("pause", function() { // do something here to store the timestamp } });
Source: https://habr.com/ru/post/1606785/More articles:Div border is not a straight line after turning in Firefox on Mac - javascriptSFSafariViewController: how to provide custom actions? - iosbootstrap-table-filter-control extension does not work in boot table - javascriptbootstrap table filter-control - how to undo unwanted values from selection options - jquerycss use the first letter of each word, uppercase - cssWhat does symbol / symbol mean in UML - androidAngular Catch a Global Click - javascriptListen to jQuery event without jQuery - javascriptКак мне вызвать функцию JavaScript из кода Asp.Net? - javascriptHow to use ClientScript.RegisterClientScriptBlock with inline code? - asp.netAll Articles