I’m developing a mobile app that requires geolocation access the whole time the app is running. I’m using mdg:geolocation and I put Geolocation.currentLocation()
inside of a Tracker.autorun
at the top of my client file. Everything works great and I can access location data.
My problem is, when you run this on an Android or iPhone, the very first thing that pops up is it asking for your location. I feel like this is bad user experience and I want it to wait until after they sign in, register, or view a page about location. I can’t take it out of the global Tracker.autorun
function because it’s always needed.
My thought was adding a field in their User document if they accepted the location already and set a session variable based on that to ask for location or not. This seems really clunky and doesn’t work 100% of the time. Especially if the user gets a new phone or signs in from a different one.