UIBackgroundModes

I’ve had a rejection notice from Apple, apparently because I am using location services in the background. I did not think this was possible with Corona. If it is, that would mean that an app like Strava can be built; For example, tracking a user’s location with accuracy while in the background.

The notice I had is:

1.0.0 Binary Rejected
June 27, 2015

2.16 Details Your app declares support for location in the UIBackgroundModes key in your Info.plist file but does not declare any features

Is it possible to modify the UIBackgroundModes value and what are the options for this key?

Can you post your build.settings?

Location services are provided by the native device’s libraries. They support being backgrounded. However, Corona SDK’s implementation assumes that there is an active UI for any thing you write in Lua. So lets say your app is backgrounded and it triggers an event, but there is no UI and your code tries to update a display object, things might get really borked when you do bring the app back to the foreground.

Starting with iOS 8, Apple requires a particular key be inserted into build.settings to announce to the user the reason you want to use the GPS.  You probably should disable any event generators from Location services when you detect a suspend happen.  I’m on the wrong computer to look up the exact key.  I’ll post it back later, or you can look for it in a previous blog post.

Rob

Add this to your settings.iphone.plist table in build.settings:

settings = {      iphone = {           plist = {               NSLocationWhenInUseUsageDescription = "Some description on how you're going to use Location Services",           }       } }

Rob

Thanks Rob.

I have removed the offending entry for background operations and the app does not perform any interface updates during that time. I added the description field so hopefully that will satisfy Apple.

Can you post your build.settings?

Location services are provided by the native device’s libraries. They support being backgrounded. However, Corona SDK’s implementation assumes that there is an active UI for any thing you write in Lua. So lets say your app is backgrounded and it triggers an event, but there is no UI and your code tries to update a display object, things might get really borked when you do bring the app back to the foreground.

Starting with iOS 8, Apple requires a particular key be inserted into build.settings to announce to the user the reason you want to use the GPS.  You probably should disable any event generators from Location services when you detect a suspend happen.  I’m on the wrong computer to look up the exact key.  I’ll post it back later, or you can look for it in a previous blog post.

Rob

Add this to your settings.iphone.plist table in build.settings:

settings = {      iphone = {           plist = {               NSLocationWhenInUseUsageDescription = "Some description on how you're going to use Location Services",           }       } }

Rob

Thanks Rob.

I have removed the offending entry for background operations and the app does not perform any interface updates during that time. I added the description field so hopefully that will satisfy Apple.