Apple is telling me this when I submit my application but I commented out the UIBackgroundModes in the build.settings. The application no longer shows the blue bar in the top saying “application using your location” when you tab out. Yet they still say it uses background location. I followed what was on the location docs. Can anyone tell me what the problem is?
iphone =
{
plist =
{
--icon image files table
CFBundleIndetifier = “us.checkplease.checkpleasemobile”,
CFBundleDisplayName = “Check Please Mobile”,
UIBackgroundModes = {
--“location”,
},
NSLocationWhenInUseUsageDescription = “We need to find restaurants close to you.”,
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-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”
},
--launch image files table (see section below)
UILaunchImages = {
},
}
},
locationHandler = function( event )
print( “locationHandler:” )
– Check for error (user may have turned off Location Services)
if event.errorCode then
native.showAlert( “GPS Location Error”, event.errorMessage, {“OK”} )
print( "Location error: " … tostring( event.errorMessage ) )
else
local latitudeText = string.format( ‘%.4f’, event.latitude )
local longitudeText = string.format( ‘%.4f’, event.longitude )
local altitudeText = string.format( ‘%.3f’, event.altitude )
local accuracyText = string.format( ‘%.3f’, event.accuracy )
local speedText = string.format( ‘%.3f’, event.speed )
local directionText = string.format( ‘%.3f’, event.direction )
– Note: event.time is a Unix-style timestamp, expressed in seconds since Jan. 1, 1970
local timeText = string.format( ‘%.0f’, event.time )
myLatPos = event.latitude
myLongPos = event.longitude
myAlititude = event.altitude
print( myLatPos, myLongPos, 123213 )
end
end
Runtime:addEventListener( “location”, locationHandler )
----- 2.16 -----
We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.
We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.
It would be appropriate to add features that require persistent use of real-time location updates while the app is in the background or remove the “location” setting from the UIBackgroundModes key. If your application does not require persistent, real-time location updates, we recommend using the significant-change location service or the region monitoring location service.
For more information on these options, please see the “Starting the Significant-Change Location Service” and “Monitoring Shape-Based Regions” sections in the Location Awareness Programming Guide.
If you choose to add features that use the Location Background Mode, please include the following battery use disclaimer in your Application Description:
“Continued use of GPS running in the background can dramatically decrease battery life.”
For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
- complete details of your rejection issue(s)
- screenshots
- steps to reproduce the issue(s)
- symbolicated crash logs - if your issue results in a crash log
If you have difficulty reproducing a reported issue, please try testing the workflow as described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.