Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Learn More

Location services in Firefox iOS

  • 5 отговора
  • 1 има този проблем
  • 1 изглед
  • Последен отговор от peter.ottenbacher.tdem

more options

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!");
       }
   }
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)

more options

Maybe try to add try{}catch(error){} code ?

more options

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

more options

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))});

more options

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

more options

Избрано решение

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.