Laurent Laurent - 6 months ago 33
Javascript Question

Geolocation not working on iOS with Meteor

It's been 5 hours i'm struggling with Meteor.

I want to get

. It works perfectly on my browser, I coupled it with GoogleMaps to put a marker on a map. I'm following this example and didn't touch it much.

When I compile on iOS the Geolocation returns weird errors on my simulator (iPhone 6 / iOS 8.3) such as
Geolocation failed : Position retrieval timed out
, sometimes it's another one which's very similar (note : it asks me if i want to share my location when i launch the app, and i accept)

geolocation meteor problem ios

Sometimes it says it just compiled and I get an old version of my app too.
What's happening ? Is it me or it's really THAT buggy once you try to make a real world project ?

This to-do list tutorial looked very magic but once you understood how it works and you try something real, it's kind of disappointing ... Sounds very unstable and not ready.

Don't hesitate to tell me if i'm doing something wrong ;)

UPDATE : i've searched a lot more and i'm now trying to setup differently the
limit of the geolocation package to avoid this error.
Sadly, i realized
timeout : Infinity
is the default value of the source : sounds like an issue.
Nothing is working so far. If anyone has an idea, let me know on that too ...


I finally made it work. First I realized you have to setup the accessRule thank to Lucas's answer but it wasn't enough.

// In a mobile-config.js in the project

The iOS Simulator provided by Apple seems to have bugs : the position isn't retrieved correctly, or not at all. It's only working if i set the the Debug > Location to City Ride ; even Apple wasn't working properly on my hand.

If nothing works for you, just try all the possible Location, it might be the problem.