Invalid value for purpose string in info.plist

In the most recent submission of my React Native iOS app to Appstore Connect, I recieved the following notification via email from Appstore Connect:

Dear Developer,

We identified one or more issues with a recent delivery for your app, "eSELFSERVE". Your delivery was successful, but you may wish to correct the following issues in your next delivery:

Invalid value for purpose string - The value 'NSLocationAlwaysUsageDescription' for Info.plist NSLocationAlwaysUsageDescription is not allowed. Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.

Best regards,

The App Store Team

They seem like contradictory errors and I am not sure how to solve them. Here is a fragment from my MyProject/Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  ...
  <key>NSLocationUsageDescription</key>
  <string>NSLocationUsageDescription</string>
  <key>NSLocationAlwaysUsageDescription</key>
  <string>NSLocationAlwaysUsageDescription</string>
  <key>NSLocationWhenInUseUsageDescription</key>
  <string>NSLocationWhenInUseUsageDescription</string>
  ...
</dict>
</plist>

Here is a fragment from en.lproj/InfoPlist.strings:

...
NSLocationUsageDescription = "This app records your location when clocking in and out. Clocking in through this app may be rejected if location information is not provided.";
NSLocationWhenInUseUsageDescription = "This app records your location when clocking in and out. Clocking in through this app may be rejected if location information is not provided.";
NSLocationAlwaysUsageDescription = "This app records your location from time to time to expedite clocking in and out. Clocking in through this app may be rejected if location information is not provided.";
...


Here is a fragment es.lproj/InfoPlist.stings:

...
NSLocationUsageDescription = "Esta aplicación registra su ubicación cuando entra y sale. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación.";
NSLocationWhenInUseUsageDescription = "Esta aplicación registra su ubicación cuando entra y sale. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación.";
NSLocationAlwaysUsageDescription = "Esta aplicación registra su ubicación de vez en cuando para agilizar el registro de entrada y salida. Entrando usando esta aplicación puede ser rechazado si no se proporciona información de ubicación.";
...


I am also using the geolocation module of React Native 0.59.1.

Accepted Reply

It’s unusual to use the

NSLocationXXX
keys as values. Normally you set the value in the
Info.plist
to be that of your development language, and then add entries in the localised strings files that need to override that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

It’s unusual to use the

NSLocationXXX
keys as values. Normally you set the value in the
Info.plist
to be that of your development language, and then add entries in the localised strings files that need to override that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi, I got the same error for apparently the same reason. Could someone clarify the recommended answer for me?

  1. What ist meant by "It's unusual"? Is it just unusual or is it not allowed? It does work, so why do we get an email about this issue?

  2. What is the right/recommended way to do this?

    "Normally you set the value in theInfo.plist to be that of your development language". Does that mean, I should use the full english sentence as the value in the Info.plist file and as the key in the InfoPlist.strings translations (and skip the English translation)? That seems very error prone to me.

Thank you!

Is it just unusual or is it not allowed?

At a technical level it’s allowed. However, it’s not the standard way of doing things and thus I’m not surprised that you’re having problems.

What is the right/recommended way to do this?

Standard practice is to use the full string of your development language. For example:

% plutil -p /System/Applications/Maps.app/Contents/Info.plist | grep NSLocationUsageDescription 
  "NSLocationUsageDescription" => "Your location is used to show your position on the map, get directions, estimate travel times, and improve search results."

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thanks. What I didn't understand at first and want to clarify for future visitors: The keys in the InfoPlist.strings files must match the key and not the value from the Info.plist file. That is why you can just set the default (english) value in the Info.plist file and localize it for other languages. In that case there is no need for an english InfoPlist.strings file. I found that if you also have an english InfoPlist.strings file, the value in Info.plist is never used.

Add a Comment