I have a mobile app and we want to capture the location where users log in from.
If they have Location Services switched on then it works perfectly.
But, if they don't then we are getting this error.
Is there any way to not show the error or at least capture the error so that we can show a message like.. "Please turn on Location Services"
TIA
MGeoLocation Problem
-
- Posts: 2409
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
MGeoLocation Problem
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: MGeoLocation Problem
in Aware's JS files (probably aware_full.js), there's code to present a dialog box.
you could modify that JS to look for that string (being sent to the msgbox function) and when found, display a "hardcoded" msg to your liking, instead of the passed in details.
you could modify that JS to look for that string (being sent to the msgbox function) and when found, display a "hardcoded" msg to your liking, instead of the passed in details.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 7526
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: MGeoLocation Problem
create your custom JS file (if you don;t already have one) and put it in Custom/JS
The file should have this code:
AwareApp.getLocation = function (objName, objId, enableHighAccuracy, successCallback, errorCallback)
{
var me = this;
navigator.geolocation.getCurrentPosition (
function (position) {
me.writeLocation (position, objName, objId, successCallback);
},
function (error) {
alert("Please turn on Location Services");
errorCallback();
},
{
enableHighAccuracy: enableHighAccuracy
}
);
};
The file should have this code:
AwareApp.getLocation = function (objName, objId, enableHighAccuracy, successCallback, errorCallback)
{
var me = this;
navigator.geolocation.getCurrentPosition (
function (position) {
me.writeLocation (position, objName, objId, successCallback);
},
function (error) {
alert("Please turn on Location Services");
errorCallback();
},
{
enableHighAccuracy: enableHighAccuracy
}
);
};
Aware IM Support Team
-
- Posts: 2409
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: MGeoLocation Problem
Perfect. Thanx Support.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....