Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position retrieval times out in ios app #64

Open
kjetilge opened this issue Jul 29, 2015 · 17 comments
Open

Position retrieval times out in ios app #64

kjetilge opened this issue Jul 29, 2015 · 17 comments

Comments

@kjetilge
Copy link

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.

@dburles
Copy link
Owner

dburles commented Jul 29, 2015

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.

@kjetilge
Copy link
Author

I use this in mobile-config:

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

@dburles
Copy link
Owner

dburles commented Jul 29, 2015

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

@kjetilge
Copy link
Author

The most relevant issue might be this one: meteor/mobile-packages#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 ?

@dburles
Copy link
Owner

dburles commented Jul 29, 2015

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

@jwjames
Copy link

jwjames commented Aug 21, 2015

Have you guys found a solution?

@william-bratches
Copy link

I am having this issue as well...

@dburles
Copy link
Owner

dburles commented Aug 27, 2015

Hey guys from both @kjetilge and my own testing I'm pretty sure that this is the underlying issue meteor/mobile-packages#62

@elalemanyo
Copy link

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

@lorensr
Copy link

lorensr commented Oct 10, 2015

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

@velum
Copy link

velum commented Oct 25, 2015

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

@Loschcode
Copy link

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.

@dburles
Copy link
Owner

dburles commented Dec 1, 2015

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

@grundmanise
Copy link

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

@mahiagit
Copy link

mahiagit commented Jan 9, 2017

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.

@adimittal
Copy link

adimittal commented Feb 2, 2018

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.

@agustinsiles
Copy link

@adimittal you saved the day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests