Gps event.errorMessage

Hello, im having some trouble with the errorMessage event.

this is the code:

if event.errorCode then native.setActivityIndicator( false ) native.showAlert( "GPS Location Error","turn on location data", {"OK"} , onCloseApp) end

but i only get the error if i have location data on and then decline access from the app. However if i turn location data off completely i get a message saying something like “turn on location data for your app to work” with the options “go to location data” “cancel”

If i press cancel at this point i dont get the error. Why?

 

Hi Jonathan,

Which system (device) are you running on?

Brent

Hi, Brent

Since I have been testing this with Jonathan, I know the answer.

We have been trying with iPhone4 and 4S. (I think it is 6.13 on both devices…)

It seems to be different when you have the app-setting on or off, and then turn the overall setting for location services on or off…

Hi @jentso,

I think you need to check the value of the error code depending on your “case”. A “non-nil” condition may be returned if location services are off. Please see what kind of results you’re getting for “.errorCode” in the different conditional cases.

Brent

Hi Jonathan,

Which system (device) are you running on?

Brent

Hi, Brent

Since I have been testing this with Jonathan, I know the answer.

We have been trying with iPhone4 and 4S. (I think it is 6.13 on both devices…)

It seems to be different when you have the app-setting on or off, and then turn the overall setting for location services on or off…

Hi @jentso,

I think you need to check the value of the error code depending on your “case”. A “non-nil” condition may be returned if location services are off. Please see what kind of results you’re getting for “.errorCode” in the different conditional cases.

Brent