GPS is not asking for authorization on iOS

Hello,

When using the map and trying to get my current location on iOS I get the error below returned:

0

“Pending user authorization” — Occurs when the device is prompting the user for authorization to use location services.

The problem is I am not getting anything on the screen to prompt me to allow the GPS. Why is this? I am using 9.2 or something like that. Below is my build settings file.

-- -- For more information on build.settings see the Corona SDK Build Guide at: -- http://docs.coronalabs.com/guide/distribution/buildSettings/index.html -- settings = { plugins = { ['plugin.toast'] = {publisherId = 'com.spiralcodestudio'}, ["plugin.openudid"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true }, }, }, orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, -- -- iOS Section -- iphone = { plist = { NSLocationWhenInUseUsageDescription = "GPS location is needed to know where the user is making their credit card location which they have authorized.", UIRequiredDeviceCapabilities = {"location-services", "gps", "magnetometer" }, NSAppTransportSecurity = { NSExceptionDomains = { ["xxxxxxxx.com"] = { NSIncludesSubdomains = true, NSThirdPartyExceptionAllowsInsecureHTTPLoads = true }, }, }, UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-167.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-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX", -- replace XXXXXXXXX with your Facebook appId } } } --]] } }, -- -- Android Section -- android = { usesPermissions = { "android.permission.INTERNET", "android.permission.READ\_PHONE\_STATE", -- 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", }, }, }

Btw, I am using the latest build from 3 days ago for OSX.

Have you already hit no on your iOS device, the pop up is a one and done deal. You have to go your app settings if you said no already

No, just loaded it on another device and set the app permissions to allow it. Then ran it and no popup. Same with someone else testing the same app.

Did this work with an older version?

I go to the app’s location settings and set always. I run the app and it does not work. Return back tot he setting for the appp  and it always goes back to never.

This is the only version of anything I have to use. I’m using the current of everything.

Have you tired the sample gps app included with corona?

I also looked under Notifications on the device and it is not listed. Maybe cause it is a development app? But is there something I can set to make sure the notifications are turned on for the app? I’m wondering if something is blocking it.

We just put the SDK through a battery of tests for the public release (2906) and We didn’t find any problems. I’m trying to verify that 9.2 got tested. I know for certain it works on 9.3.

I just looked and when I go to compile for iOS the corona program only allows 9.3. In grey it says if I want 9.2 then I need to install xcode 7.2.

Install or xcode select 7.2 is what it says actually.

Building with the iOS 9.3 SDK and Xcode 7.3 will work just fine on 9.2 devices, and iOS 8 and 7 and maybe 6.

Thanks but something is causing this not to work as far as location services.

Go to application>coronasdk>sample code>hardware> gps and look at that

I was going to use the locationHandler method like in this app example but I could not figure how to stop it after it got the location. Each time I tried to cancel the eventHandler it still kept going even after I changed scenes. I’ll see if it works anyways on my device.

Here the deal o about composer. It only handles objects in the scene groups and that is about it. You are responsible for runtime events, timers, and physics.

Composer does do other thing like store data, mange files, handle recycling, and scene management, I did not mean to insult composer like that :slight_smile:

I know how to use all of it but it doesn’t always listen. For example, I put in the locationHandler to cancel the event after a location was retrieved and it did not for some reason. Maybe it was how I coded it. I’m working on it now and will post the code if it does not work right.

Thanks!

I don’t know how you coded but it should be Runtime:removeEventListener(“location”, lis)