No Location Service on iOS 9.2

I have posted my problem on the iOS discussion group, but not much activity there. So I try here…

 

My app is a simple one which, at the tap of a button, sends a timestamp and the location of the device over http. Then, in return, it gets a response from a server which it displays. The app runs OK on all Android devices and on an older iPhone 4 running on iOS 7. But the testers at Apple claim it doesn’t request any location from the GPS on devices running iOS 9.2. They’ve tested it on an iPhone 6 and on an iPad Air, both running iOS 9.2

 

Unfortunately I don’t have access to such devices. The app is tested on both the Corona simulator and on Apples own Xcode simulator, and runs OK. From the net I have read on several forums that there are issues with iOS 9.2 and Location Services, but I am uncertain if this is the case here.

What can possibly be wrong? I am a little stuck, so any help will be highly apreciated.

Is this a repost?

Well, I have rephrased my problem and posted it here since the iOS discussion group has fewer participants than this. If this violates the forum rules, I ask for forgiveness.

If you have the privilege, you are free to delete it. But my hope is that there is somebody out there who has experienced the same issue and maybe could give me a hint.

I don’t think anyone else is going to have a different answer than I’ve provided. If you can’t get an iOS 9.2 device to test on, you have choices of TestFlight or the Facebook group. I would hope any one you get to help you test would be a developer who had Xcode and could look for console messages for you.

I just tested one of my apps which uses native.newMapView and GPS and it’s working fine on my iPad 4 running iOS 9.2.

Rob

OK, I understand. The facebook group doesn’t give me any response, so this was a blind shot.

Since Apple claims my app never requests access to the Location Services, I suppose there must be something missing in my build.setting. Can you please review it and see if something is missing or is wrong?

settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, CFBundleShortVersionString = "1.3", NSLocationWhenInUseUsageDescription = "Georeg trenger tilgang til GPS", UIBackgroundModes = {"location", }, UIPrerenderedIcon = true, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, android = { usesPermissions = { -- Permission to retrieve current location from the GPS. "android.permission.ACCESS\_FINE\_LOCATION", -- Permission to retrieve current location from WiFi or cellular service. "android.permission.ACCESS\_COARSE\_LOCATION", -- Permission to access the internet "android.permission.INTERNET", -- Permission to vibrate "android.permission.VIBRATE", }, }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", },]]-- }

I would consider removing these lines:

            UIBackgroundModes = {“location”, },
            UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

Apple doesn’t  want apps to exit on suspend. We don’t support backgrounding. You’re app says it’s going to run in background mode, but you’re not providing the right information key for using the GPS in the background.

Rob

In case this helps…

I had a problem with location on IOS. Location worked fine on iPhone4 (IOS 7) but customers had problem with IOS9.

Eventually discovered that I was missing this line from build.settings plist entry.

NSLocationWhenInUseUsageDescription=“some text”

Hi conor1,

I have already included this plist entry in the build.settings. I am now pretty empty of ideas and on the brinck og giving up. I have struggled since November, but the only response I get from Apple is “Rejected”. They claim the app doesn’t request permission at first startup to access the Location Service. But when testing on the Xcode simulator it does for every iOS 9.2 gadgets in their menu.

I have tried to initiate the Test Flight facility in Itunes Connect, but no email is ever sent to my testers. I probably do something wrong, but I don’t have the guts (neither the time) to read all the Apple documents to understand why.

Just for the record; my app was originally launched for iOS 7 in the Apple Store 2 years ago. Now I only try to implement a minor change, but since iOS 8+ requires this acceptance at first startup I’m now stranded.

Have anybody EVER managed to get an app using Location Services in iOS 8+ approved by Apple? If so I’ll be glad to mail my source code for review.

Take this out:  UIBackgroundModes = {“location”, },

EDIT: When the GPS is expected to work in the background, Apple looks for a different key other than NSLocationWhenInUseUsageDescription. This is likely why you are being rejected.

Corona Labs does not support backgrounded applications.  Some users have had luck with a backgrounded app, but we don’t support it. You would need to change the NSLocationXXX option.

Rob

Rob,

This line has been removed as you suggested in your response Jan. 14th. But this didn’t help either. I have also cleaned my build.settings in order to avoid Apple nagging about missing icons. Today (and in my last submission to Apple) it looks like this:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, CFBundleShortVersionString = "1.3", NSLocationWhenInUseUsageDescription = "Georeg trenger tilgang til GPS", UIPrerenderedIcon = true, -- set to false for "shine" overlay UIRequiredDeviceCapabilities = {"location-services", "gps"}, -- Icon image files table CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-167.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, -- iOS app URL schemes: CFBundleURLTypes = { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } }, android = { usesPermissions = { -- Permission to retrieve current location from the GPS. "android.permission.ACCESS\_FINE\_LOCATION", -- Permission to retrieve current location from WiFi or cellular service. "android.permission.ACCESS\_COARSE\_LOCATION", -- Permission to access the internet "android.permission.INTERNET", -- Permission to vibrate "android.permission.VIBRATE", }, }, -- Android permissions androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", }, }

I have also added the plist key UIRequiredDeviceCapabilities = { “location-services”, “gps” } to restrict the app to work only on devices with a real GPS inside (Apple use the term “Location Service” even for non-3G iPads using only Wifi to establish location)

Is this a repost?

Well, I have rephrased my problem and posted it here since the iOS discussion group has fewer participants than this. If this violates the forum rules, I ask for forgiveness.

If you have the privilege, you are free to delete it. But my hope is that there is somebody out there who has experienced the same issue and maybe could give me a hint.

I don’t think anyone else is going to have a different answer than I’ve provided. If you can’t get an iOS 9.2 device to test on, you have choices of TestFlight or the Facebook group. I would hope any one you get to help you test would be a developer who had Xcode and could look for console messages for you.

I just tested one of my apps which uses native.newMapView and GPS and it’s working fine on my iPad 4 running iOS 9.2.

Rob

OK, I understand. The facebook group doesn’t give me any response, so this was a blind shot.

Since Apple claims my app never requests access to the Location Services, I suppose there must be something missing in my build.setting. Can you please review it and see if something is missing or is wrong?

settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, CFBundleShortVersionString = "1.3", NSLocationWhenInUseUsageDescription = "Georeg trenger tilgang til GPS", UIBackgroundModes = {"location", }, UIPrerenderedIcon = true, -- set to false for "shine" overlay UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, android = { usesPermissions = { -- Permission to retrieve current location from the GPS. "android.permission.ACCESS\_FINE\_LOCATION", -- Permission to retrieve current location from WiFi or cellular service. "android.permission.ACCESS\_COARSE\_LOCATION", -- Permission to access the internet "android.permission.INTERNET", -- Permission to vibrate "android.permission.VIBRATE", }, }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", },]]-- }

I would consider removing these lines:

            UIBackgroundModes = {“location”, },
            UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

Apple doesn’t  want apps to exit on suspend. We don’t support backgrounding. You’re app says it’s going to run in background mode, but you’re not providing the right information key for using the GPS in the background.

Rob

In case this helps…

I had a problem with location on IOS. Location worked fine on iPhone4 (IOS 7) but customers had problem with IOS9.

Eventually discovered that I was missing this line from build.settings plist entry.

NSLocationWhenInUseUsageDescription=“some text”

Hi conor1,

I have already included this plist entry in the build.settings. I am now pretty empty of ideas and on the brinck og giving up. I have struggled since November, but the only response I get from Apple is “Rejected”. They claim the app doesn’t request permission at first startup to access the Location Service. But when testing on the Xcode simulator it does for every iOS 9.2 gadgets in their menu.

I have tried to initiate the Test Flight facility in Itunes Connect, but no email is ever sent to my testers. I probably do something wrong, but I don’t have the guts (neither the time) to read all the Apple documents to understand why.

Just for the record; my app was originally launched for iOS 7 in the Apple Store 2 years ago. Now I only try to implement a minor change, but since iOS 8+ requires this acceptance at first startup I’m now stranded.

Have anybody EVER managed to get an app using Location Services in iOS 8+ approved by Apple? If so I’ll be glad to mail my source code for review.

Take this out:  UIBackgroundModes = {“location”, },

EDIT: When the GPS is expected to work in the background, Apple looks for a different key other than NSLocationWhenInUseUsageDescription. This is likely why you are being rejected.

Corona Labs does not support backgrounded applications.  Some users have had luck with a backgrounded app, but we don’t support it. You would need to change the NSLocationXXX option.

Rob

Rob,

This line has been removed as you suggested in your response Jan. 14th. But this didn’t help either. I have also cleaned my build.settings in order to avoid Apple nagging about missing icons. Today (and in my last submission to Apple) it looks like this:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, CFBundleShortVersionString = "1.3", NSLocationWhenInUseUsageDescription = "Georeg trenger tilgang til GPS", UIPrerenderedIcon = true, -- set to false for "shine" overlay UIRequiredDeviceCapabilities = {"location-services", "gps"}, -- Icon image files table CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-167.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, -- iOS app URL schemes: CFBundleURLTypes = { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } }, android = { usesPermissions = { -- Permission to retrieve current location from the GPS. "android.permission.ACCESS\_FINE\_LOCATION", -- Permission to retrieve current location from WiFi or cellular service. "android.permission.ACCESS\_COARSE\_LOCATION", -- Permission to access the internet "android.permission.INTERNET", -- Permission to vibrate "android.permission.VIBRATE", }, }, -- Android permissions androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", }, }

I have also added the plist key UIRequiredDeviceCapabilities = { “location-services”, “gps” } to restrict the app to work only on devices with a real GPS inside (Apple use the term “Location Service” even for non-3G iPads using only Wifi to establish location)

Did you figure this out? I am having the same problem with 9.2.