- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 06:13 AM
Is there a way to get a users location when using the browser based mobile UI?
I put the "current_location" attribute on a field and was able to get the users location when using the actual Android SN Mobile app but this attribute does not affect the field when viewing in the browser mobile UI. Is there any way to get the users location when using the mobile browser?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 08:14 AM
I figured this out for anybody who is interested in the solution. I used HTML5's built in geolocation capability with an onLoad Client Script.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(UserLocation);
} else {
alert('Geolocation is not supported by this browser');
}
// Callback function for asynchronous call to HTML5 geolocation
function UserLocation(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
alert(latitude + ',' + longitude);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 08:14 AM
I figured this out for anybody who is interested in the solution. I used HTML5's built in geolocation capability with an onLoad Client Script.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(UserLocation);
} else {
alert('Geolocation is not supported by this browser');
}
// Callback function for asynchronous call to HTML5 geolocation
function UserLocation(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
alert(latitude + ',' + longitude);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 08:56 AM
Thank you for posting your solution. This is very helpful for those of us who need to determine a user's location.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2017 03:58 AM
Hi Greg
Can you help me on how it was done for SN Android Mobile App?
-Kalyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2024 04:51 AM
Hi @kalyanrao follow this link to get user's current location using SN Android Mobile App
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Adarsh Gunjan