How to translate NSLocationTemporaryUsageDescriptionDictionary (iOS 14) strings?

Viewed 442

I want to show the user the location permission alert when we need their precise location on iOS 14 with a localised purpose string. According to the docs you need to have a InfoPlist.strings file with the same key you provide in your plist file like so:

<key>NSLocationTemporaryUsageDescriptionDictionary</key>
    <dict>
        <key>Purpose1</key>
        <string>Purpose1Localized</string>
    </dict>

And in your InfoPlist.strings file:

"Purpose1Localized" = "We need your precise location for....";

But this isn't working for me on Xcode 12 beta 6. Does anyone know if this a bug or am I doing something wrong?

1 Answers

Use the key of the option in the strings file. "Purpose1" = "We need your precise location for....";

Related