![Firefox iOS 버전 logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-37-48-1aeaf0_1.png)
Location services in Firefox iOS
I am a web developer for a state agency and was having a bit of an issue with getting Firefox for iOS to work with our current get location code. Most of the other browsers work with the following, including Firefox desktop and Firefox Mobile.
Is there something different about iOS that I am missing. On the JS fiddle the console.log runs, but it just stops after that.
Any help would be appreciated? or being able to access the console.log in the iOS browser as well?
Thank you, Peter Ottenbacher [email]
function Geolocate() {
console.log("getting location"); //check if the geolocation object is supported, if so get position if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(displayLocation, displayError); } else { alert("Sorry - your browser doesn't support geolocation!"); } }
글쓴이 Andrew 수정일시
선택된 해결법
Ha ha figured it out. Cleared cookies in Firefox on iPhone and it worked. Weird note: alert(platform.name) returned Safari and Firefox for iOS at different intervals.
Thank you for the trouble shooting help cor-el.
문맥에 따라 이 답변을 읽어주세요 👍 0모든 댓글 (5)
Maybe try to add try{}catch(error){} code ?
Does it not work with location service is really my main question? There isn't much anything online saying it does or doesn't.
There us a try/catch situation further in the code, but doesn't seem to get that far.
The site asks for permission, as I have checked in settings, then I say "this time" and it seems to load, but no magic. Is there a way to get to the console.log in the phone for Firefox?
글쓴이 peter.ottenbacher.tdem 수정일시
I do not have an iOS phone, does something like this work?
navigator.geolocation.getCurrentPosition(function(loc){ alert('Your current position is:\nLatitude: '+loc.coords.latitude+'\nLongitude: '+loc.coords.longitude+'More or less: '+loc.coords.accuracy+' meters'); },function(err){alert(JSON.stringify(err))});
I will try today, thank you for the info. I was also going to try this one that I found
if ('geolocation' in navigator) {
alert("'geolocation' in navigator") } else { /* geolocation IS NOT available */ alert("geolocation IS NOT available") }
I will let you know if either work.
I found this too yesterday and it doesnt seem like it will work in Firefox for iOS. I just need to confirm or if there is a workaround....
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation
선택된 해결법
Ha ha figured it out. Cleared cookies in Firefox on iPhone and it worked. Weird note: alert(platform.name) returned Safari and Firefox for iOS at different intervals.
Thank you for the trouble shooting help cor-el.