Geolocation component, get device coordinates

Hey, guys,

I have a question that I think is a little silly, I’m trying to use the Geolocation component to get users’ coordinates, but it only gets it from computers, on smartphones that message doesn’t even appear to give permission to get it, is there a secret to this?

Thanks

It should work fine on mobiles. It sounds to me like the settings on the phone are preventing it.

So I tested other sites, normally it takes the device’s location, but a popup appears allowing you to give that location, here it is not appearing, I believe that on cell phones there needs to be a popup allowing you to give that location, correct? I tested on iOS and Android, both didn’t give me latitude and longitude

The phone’s OS will ask for permission before giving the coordinates so it looks like the request isn’t happening. Did you say the same page works fine on desktop? If so, check the settings in the mobile to make sure it’s not just rejecting the request outright.

So I checked with other sites that ask for this permission, it worked correctly, I’m wondering if it’s because it’s localhost and not https?

How are you visiting it on localhost if it’s on a mobile?

And yes, I believe it has to be https to use locations.