How to prompt for permission to use current location

I have a tool that allows you to test my API. One of the functions of the API is to upload a photo and read and store the EXIF data. If I use the tool from a phone (ios) it strips the data from a PC it works fine. I believe this is because the web page does not have permission to access LBS on the phone. I have seen other pages ask for permission and I am assuming I need to as well but not sure how and my search so far has failed. Please let me know how to request this permission.
Who is Participating?
Giovanni HewardConnect With a Mentor Commented:
Instead of the Exif route, you could look into the browser Geolocation API.


if (navigator.geolocation) {
     // Browser supports it, we're good to go!
} else {
     alert('Sorry your browser doesn\'t support the Geolocation API');

Open in new window

If memory serves the exif data is stripped by iOS prior to the upload, this is from a while back and I don't if it is still relevant.
skioneAuthor Commented:
Firstly, this problem happens within the app as well as the API test tool. I need exif data because I need more than GPS coordinates. (ISO, appeture, etc). I know it can be done because the flickr app is doing it. I was assuming that asking for location permission would allow this to work. Perhpas that is not the only thing that needs to be done, with that said, there still must be a way for a website to ask for location permission since google maps (and others) are doing it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.