Apple rejection based on location, but followed docs.

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.

Hi @kcrandall,

By your code, it looks like you commented out the value of UIBackgroundModes (“location”), but you didn’t comment out the UIBackgroundModes key itself. Can you remove the entire key-value pair and try re-submitting?

Brent

Thanks Brent,

Yes, I can do that. Did it just add some service by default when the key-value pair is there? It’ll take another week to get reviewed. Is there any way to check that after building it that it doesn’t use background services? 

Kes

Hi Kes,

I’m guessing that Apple doesn’t like it being an “empty” value, so their system auto-flags a rejection.

By the way, where does this citation for the key-value pair come from? Is it within the Corona docs? I don’t recall seeing it anywhere (and I maintain most of the documentation). Do we state somewhere that this key-value pair should be added for location services?

Thanks,

Brent

I think that was from a post somewhere after iOS8 came out because in iOS8 you need NSLocationWhenInUseUsageDescription = “a message.” to be added to the build settings otherwise it doesn’t start using the service. That post also had background service key-value pair in it. I copied the entire thing into the build.settings after it stopped working and it fixed it so I left it. Then the rejected it so it made sense to comment that line out. Then second week it got rejected and made no sense so I posted here.

Hi Kes,

I found that blog post and you’re correct on there being some change, specifically the “NSLocationWhenInUseUsageDescription” part. However, I see no mention of the “UIBackgroundModes” key in that post. Did you gather this from some Apple document?

Thanks,

Brent

It’s probably a forum post (I found at least two)

Corona SDK does not support location services in the background.  Corona SDK needs to have an active UI on the screen for any API calls to work.  I know some people (myself included) have built background audio apps (like podcasting) on iOS using background modes, that works (though still unsupported) because no UI is needed to play the audio.   

Rob

Brent’s solution worked it went right through after removing the empty key-value pair. Thank you.

Hi @kcrandall,

By your code, it looks like you commented out the value of UIBackgroundModes (“location”), but you didn’t comment out the UIBackgroundModes key itself. Can you remove the entire key-value pair and try re-submitting?

Brent

Thanks Brent,

Yes, I can do that. Did it just add some service by default when the key-value pair is there? It’ll take another week to get reviewed. Is there any way to check that after building it that it doesn’t use background services? 

Kes

Hi Kes,

I’m guessing that Apple doesn’t like it being an “empty” value, so their system auto-flags a rejection.

By the way, where does this citation for the key-value pair come from? Is it within the Corona docs? I don’t recall seeing it anywhere (and I maintain most of the documentation). Do we state somewhere that this key-value pair should be added for location services?

Thanks,

Brent

I think that was from a post somewhere after iOS8 came out because in iOS8 you need NSLocationWhenInUseUsageDescription = “a message.” to be added to the build settings otherwise it doesn’t start using the service. That post also had background service key-value pair in it. I copied the entire thing into the build.settings after it stopped working and it fixed it so I left it. Then the rejected it so it made sense to comment that line out. Then second week it got rejected and made no sense so I posted here.

Hi Kes,

I found that blog post and you’re correct on there being some change, specifically the “NSLocationWhenInUseUsageDescription” part. However, I see no mention of the “UIBackgroundModes” key in that post. Did you gather this from some Apple document?

Thanks,

Brent

It’s probably a forum post (I found at least two)

Corona SDK does not support location services in the background.  Corona SDK needs to have an active UI on the screen for any API calls to work.  I know some people (myself included) have built background audio apps (like podcasting) on iOS using background modes, that works (though still unsupported) because no UI is needed to play the audio.   

Rob

Brent’s solution worked it went right through after removing the empty key-value pair. Thank you.