Where to provide Location Usage Descriptions for iOS?

1436
2
Jump to solution
07-04-2017 12:19 AM
KristofDewilde
New Contributor II

Morning! So our iOS app has just been rejected by Apple because, quote: "app uses background location services but does not clarify the purpose of its use in the location modal alert as required in the iOS Human Interface Guidelines". It states that to resolve this issue, we need to revise the NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription in the Info.plist, but where does one set these values in an AppStudio app?

Thanks!

1 Solution

Accepted Solutions
SathyaPrasad
Esri Contributor

With AppStudio version 2.0, background location is supported. To get this to work correctly (and get it approved in the app stores) follow the steps shown below:

1. Make sure you are using latest version of AppStudio desktop (v 2.0 and above)

2. Select you app in desktop and goto Settings -> Capabilites and make sure the "Background location" switch is turned on and click "Apply". This is a new option so do not miss this step.

Notes for the curious: Behind the scenes when you turn this switch on a new parameter "backgroundLocation" gets added in "capabilities" section of appinfo.json 

3. You can optionally provide a description for these capabilities specifically for Apple devices and app stores to let the end users know as to why you are requesting this capability such as background location. Open "appinfo.json" and add the following key-value pairs "locationAlwaysUsageDescription", "locationWhenInUseUsageDescription" as required under "usageDescriptionKeys" (see the screenshot below for correct usage and placement in the appinfo.json file). This is a file editing process for now and in the next version of AppStudio desktop (2.1), we will provide a nice user interface to add these more seamlessly.

Notes for the curious: I said optional earlier since we do have a fallback of default strings if the capability is turned on and there are no overrides in the appinfo.json. Also adding all strings to override within the "usageDescriptionKeys" in appinfo.json does not hurt since the cloud make will only pick the strings based on which capability has been turned on. 

cc: Nakul ManochaTina Jin

View solution in original post

2 Replies
SathyaPrasad
Esri Contributor

With AppStudio version 2.0, background location is supported. To get this to work correctly (and get it approved in the app stores) follow the steps shown below:

1. Make sure you are using latest version of AppStudio desktop (v 2.0 and above)

2. Select you app in desktop and goto Settings -> Capabilites and make sure the "Background location" switch is turned on and click "Apply". This is a new option so do not miss this step.

Notes for the curious: Behind the scenes when you turn this switch on a new parameter "backgroundLocation" gets added in "capabilities" section of appinfo.json 

3. You can optionally provide a description for these capabilities specifically for Apple devices and app stores to let the end users know as to why you are requesting this capability such as background location. Open "appinfo.json" and add the following key-value pairs "locationAlwaysUsageDescription", "locationWhenInUseUsageDescription" as required under "usageDescriptionKeys" (see the screenshot below for correct usage and placement in the appinfo.json file). This is a file editing process for now and in the next version of AppStudio desktop (2.1), we will provide a nice user interface to add these more seamlessly.

Notes for the curious: I said optional earlier since we do have a fallback of default strings if the capability is turned on and there are no overrides in the appinfo.json. Also adding all strings to override within the "usageDescriptionKeys" in appinfo.json does not hurt since the cloud make will only pick the strings based on which capability has been turned on. 

cc: Nakul ManochaTina Jin

KristofDewilde
New Contributor II

Many thanks for this very complete answer, Sathya!