MGeoLocation Problem

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

MGeoLocation Problem

Post by customaware »

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.
No Location.jpg
No Location.jpg (59.47 KiB) Viewed 4513 times
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
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: MGeoLocation Problem

Post by Jaymer »

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.
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
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: MGeoLocation Problem

Post by aware_support »

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
}
);
};
Aware IM Support Team
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: MGeoLocation Problem

Post by customaware »

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....
Image
Post Reply