Geolocation not working on iOS 8

  • 37
  • Problem
  • Updated 4 years ago
  • Solved
Im testing our PG app for the coming iOS 8 release and I can't get the geolocation plugin to get my position. Everything works fine under iOS 7. Im currently using iOS 8 Beta 5 and the latest cordova and geolocation plugin builds.
Photo of Karl Söderberg

Karl Söderberg

  • 1 Post
  • 0 Reply Likes

Posted 6 years ago

  • 37
Photo of Plenum

Plenum

  • 37 Posts
  • 1 Reply Like
Hi Ryan,

My App Id is 1059690.

I would really appreciate it if you could have a look at the App to see what I am doing wrong.

Many thanks,
Ed.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Sure, but first what behaviour are you expecting and what are you observing?
Photo of Uwe Mutz

Uwe Mutz

  • 5 Posts
  • 0 Reply Likes
Hi,
I'm also having troubles using iOS 8 and BACKGROUND MODE for geolocation. Is there an update for geolocation.js?
Ciao
Uwe
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
No, geolocation.js is included and loaded automatically by the Geolocation plugin, you should not be including this yourself (if your are).

What are your troubles exactly?
Photo of Uwe Mutz

Uwe Mutz

  • 5 Posts
  • 0 Reply Likes
The problems I HAD was that the plugin wasn't working in background mode. As far as I have tested my Apps the problem has been solved. Thanx for the reply.
PS: I actually DID include the geolocation.js manually (by 'script src="geolocation.js"'...) within my HTML code and it never generated any error. Shouldn't this be done?
Photo of Oscar Abilleira Muñiz

Oscar Abilleira Muñiz

  • 157 Posts
  • 5 Reply Likes
In ios 8, usig phonegap 3.6.3 my app shows the prompt properly but when the app tries to get current location the result is "The operation couldn't be completed. (kCLError Domain error 0)

Any idea ?
Photo of Ena Cahilig

Ena Cahilig

  • 29 Posts
  • 0 Reply Likes
Maybe this can help you http://stackoverflow.com/questions/14...

P.S. make sure you have a stable internet connection. I get that error by whenever I don't have a connection.
Photo of Oscar Abilleira Muñiz

Oscar Abilleira Muñiz

  • 157 Posts
  • 5 Reply Likes
Thanks, I read that and other threads before... but I had found not solutions :)

Yes I have internet connection only using wiffi, I tested in ipod touch and ipad... I a haven't an iphone for test it

In previous versions of ios I have not this problema with the same app
Photo of Ena Cahilig

Ena Cahilig

  • 29 Posts
  • 0 Reply Likes
Is your geolocation plugin in latest version? 0.3.10?
Photo of Oscar Abilleira Muñiz

Oscar Abilleira Muñiz

  • 157 Posts
  • 5 Reply Likes
of course ...

My app id 167401
Photo of Samit Parade

Samit Parade

  • 2 Posts
  • 0 Reply Likes
same problem while fetching location on ios 8. occurs bcoz of the plugins .
Is there any alterenative way to made that chnages.
Photo of Nate McGuire

Nate McGuire

  • 1 Post
  • 0 Reply Likes
Using version 0.3.12 - experiencing this same error on iOS 8.2.

Geolocation is timing out, never showing the popup to request permissions. The 'NSLocationAlwaysUsageDescription' has been added to the config.xml, but still no popup.
Photo of mathias.m

mathias.m

  • 1 Post
  • 0 Reply Likes
It worked for me, when I added "NSLocationAlwaysUsageDescription" and manually enabled location services (Always) for my application. It didn't work with "NSLocationWhenInUseUsageDescription" - permission denied. This is unfortunate because:
- the popup doesn't appear, user needs to enable permission manually which is not intuitive
- it gives the app permission to determine the position also when running in the background, which is not the privilege I want to give to the app

Is there a fix for that or is it iOS limitation?

OS: Mac OS X
Phonegap: 0.9.4
Cordova: 5.1.1
iOS: 8.3
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
Are you using the Geolocation plugin from the npm source, or from PGB?

-yiming
Photo of Alberto Najera

Alberto Najera

  • 74 Posts
  • 3 Reply Likes
Hello,

Does background geolocation actually works in IOS 9.3.1?

Our app is based on background geolocation and plots a track log of the user's movements. We have added the code suggestions mentioned in this conversation but have not been able to make it work.

We have this in the config file:

<gap:config-file platform="ios" parent="UIBackgroundModes" overwrite="false"><array><string>location</string></array></gap:config-file>

<gap:config-file platform="ios" parent="NSLocationAlwaysUsageDescription" overwrite="false"><string></string></gap:config-file>


and upon starting the app for the first time, the user gets prompted to allow for geolocation even when the app is in the background, so far so good. But as soon as the app goes to the background, it stops getting geolocation and the track log is no longer updated. All is resumed as soon as the app comes back to the foreground.

After reading the full conversation it is not yet clear for us whether the current phone gap build and geolocation plugin support  backround geolocation in IOS. The same app works well in Android


Also, what is the difference among overwrite="false" and overwrite="true" in the above code?  I have seen both used in the samples in this conversation.

App ID: 1517239

Thank you
(Edited)