meteor-google-maps icon indicating copy to clipboard operation
meteor-google-maps copied to clipboard

Position retrieval times out in ios app

Open kjetilge opened this issue 9 years ago • 17 comments

I'm trying to run the Reactive geolocation example.

When i do: meteor run ios , then In the simulator The map shows up correctly for about 8 seconds and then it goes away and I see the message: Geolocation failed: Position retrieval timed out.

Is this a bug ? or is there a way around this. Everything works fine on the desktop browser.

kjetilge avatar Jul 29 '15 05:07 kjetilge

Hey, I'm not entirely sure but it's probably something to do with the application not having permission to access geolocation information. Possibly some config required there.

dburles avatar Jul 29 '15 05:07 dburles

I use this in mobile-config:

App.accessRule('https://*.googleapis.com/*');
App.accessRule('https://*.google.com/*');
App.accessRule('https://*.gstatic.com/*');

kjetilge avatar Jul 29 '15 05:07 kjetilge

Might be worth looking here https://github.com/meteor/mobile-packages/issues

dburles avatar Jul 29 '15 05:07 dburles

The most relevant issue might be this one: https://github.com/meteor/mobile-packages/issues/62 May be also subscriptions etc could be involved ?

The app is just a plain new app with the Reactive geolocation example in a layout using iron router: the app is here: https://github.com/kjetilge/ReactiveGeolocation Have you tested this code on mobile ?

kjetilge avatar Jul 29 '15 05:07 kjetilge

Just had a look into it myself and I believe the issue you linked is the issue I'm also seeing.

dburles avatar Jul 29 '15 06:07 dburles

Have you guys found a solution?

jwjames avatar Aug 21 '15 20:08 jwjames

I am having this issue as well...

william-bratches avatar Aug 26 '15 13:08 william-bratches

Hey guys from both @kjetilge and my own testing I'm pretty sure that this is the underlying issue https://github.com/meteor/mobile-packages/issues/62

dburles avatar Aug 27 '15 00:08 dburles

I am having this issue as well... geolocation is working on browser but not on iOS... any help/fix?

elalemanyo avatar Sep 22 '15 14:09 elalemanyo

The geolocation code is a page long, shouldn't be too hard to fix, perhaps going off of this fork: https://github.com/meteor/mobile-packages/pull/87

lorensr avatar Oct 10 '15 05:10 lorensr

I am having the same issue. Was this ever fixed?

velum avatar Oct 25 '15 06:10 velum

Same issue here, anyone fixed it ?

PS : Why isn't there anyone with a proper solution here ? This issue is opened since July and many people are having it.

Loschcode avatar Nov 24 '15 16:11 Loschcode

@Loschcode unfortunately the root of the problem lies with the geolocation package

dburles avatar Dec 01 '15 00:12 dburles

For everyone with this issue: http://stackoverflow.com/a/31074901/4541800 This is my solution (won't suit everyone):

// Don't show error if error.code === 3 (Timeout)
    geolocationError() {
        let error = Geolocation.error();
        return error && error.code !== 3 && error.message;
    }

grundmanise avatar Jun 08 '16 22:06 grundmanise

Is there any solution to this Problem. Everything works fins but when we pan fast or click many times then the map becomes idle and give unpleasent experience. actually it throws error as Geolocation failed: Position retrieval timed out. Any input.

mahiagit avatar Jan 09 '17 13:01 mahiagit

I've figured out the solution to this problem. Go to the info.plist file for your app in Xcode and add two entries:

NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription

The values can be any strings you want to display to the user for why he should allow geolocation for your app. Rebuild and deploy.

adimittal avatar Feb 02 '18 22:02 adimittal

@adimittal you saved the day

agustinsiles avatar Feb 24 '18 17:02 agustinsiles