GPS sample does not work on device

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.

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

Thank you, this is brilliant. You just solved one of those “well, that’s blown the whole thing!” situations :slight_smile:

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

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.

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

Rob

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.

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

Thank you, this is brilliant. You just solved one of those “well, that’s blown the whole thing!” situations :slight_smile:

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

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.

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

Rob

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.