Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GPS sample does not work on device
Started by horacebury Sep 30 2014 01:14 PM

5 replies to this topic
gps sample location

Best Answer roaminggamer , 30 September 2014 - 03:32 PM

This may be related: http://forums.coronalabs.com/topic/51259-location-services-dont-work-in-ios-8-now-apparently-fixed-in-daily-build/

 

There have been some changes recently to GPS and iOS

 

Try adding this to your build settings plist:

      plist = {
         NSLocationWhenInUseUsageDescription = "Some message to show people that you're asking for location services",
         UIBackgroundModes = {"location", },

-Ed

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

Running the GPS sample on-device with an iPhone 5s does not provide any lat/lon data. I have not tried walking around to see if passing the threshold causes location events to be generated.



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,587 posts
  • Corona SDK

  Best Answer

This may be related: http://forums.coronalabs.com/topic/51259-location-services-dont-work-in-ios-8-now-apparently-fixed-in-daily-build/

 

There have been some changes recently to GPS and iOS

 

Try adding this to your build settings plist:

      plist = {
         NSLocationWhenInUseUsageDescription = "Some message to show people that you're asking for location services",
         UIBackgroundModes = {"location", },

-Ed



[TOPIC: post.html]
#3

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

Thank you, this is brilliant. You just solved one of those "well, that's blown the whole thing!" situations :)

 

I'm assuming this is not a problem for Android, which I can't test on device?



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,587 posts
  • Corona SDK

I think GPS on Android is the same as before, but I haven't tested recently.  I'll post back when I do and if I find any problems.



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,925 posts
  • Enterprise

Please note:  Corona SDK does not support backgrounding features of IOS, including using the GPS in the background.

 

Rob



[TOPIC: post.html]
#6

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,069 posts
  • Corona SDK

It does appear as though it does, from the user's point of view, however, because if a GPS listener is left registered with the Runtime when the app is exited, iOS will display the blue Location services in use bar at the top. Remove the listener on system exit and suspend events to stop this.




[topic_controls]
[/topic_controls]