Ionic v1 app needs to check if the Mobile Device (Android or iOS) has Automatic Time Zone enabled, how can I do that? I imagine it's done using ngCordova.
For some actions, Automatic Time Zone has to be enabled so the server will receive real date and time instead of fake ones. I won't allow the user to proceed if it's disabled.
I have created this ngcordova plugin to do that, at the moment it only supports Android. iOS is not supported because it doesn't expose iPhone's Date and Time settings programatically.
window.VerifyAutomaticDateTimeZone.isAutomaticChecked(function(isIt){
if (isIt == 'true') {
// do something
} else {
// do something else
}
});
In case window.VerifyAutomaticDateTimeZone
is undefined, wrap the call with $ionicPlatform.ready
or ionic.Platform.ready
$ionicPlatform.ready(function(){
// code here...
});