Skip to content

[iOS] Warning for missing NSLocationAlwaysAndWhenInUseUsageDescription #26

Open
@davidofwatkins

Description

@davidofwatkins

My team recently updated to @capacitor/android 7.1.0 and @capacitor/geolocation 7.1.1. When we submitted our iOS app for App Store review, we received the following ITMS-90683 warning:

ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “App.app” bundle should contain a NSLocationAlwaysAndWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required.

This was confusing because, as far as I know, @capacitor/geolocation doesn’t support the “always” location permission. Comments like this and this support my understanding. We are not running @capacitor/background-runner or any “background mode” capabilities in Xcode, so I know we aren’t secretly requesting background location permissions anywhere.

However, the README for @capacitor/geolocation does state that the NSLocationAlwaysAndWhenInUseUsageDescription permission is required:

Apple requires privacy descriptions to be specified in `Info.plist` for location information:
- `NSLocationAlwaysAndWhenInUseUsageDescription` (`Privacy - Location Always and When In Use Usage Description`)
- `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`)
Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode

This appears to be a recent change, as the older README in the capacitor-plugins repo only mentions NSLocationWhenInUseUsageDescription (as I’d expect). It's possible that another plugin or dependency is causing our problem, but this README change makes me think the issue lies somewhere with the latest version of @capacitor/geolocation.

My questions are:

  • Why is NSLocationAlwaysAndWhenInUseUsageDescription now required by this plugin even if background location is not requested (or possible)?
  • If this isn’t a bug, what’s the best way to address this? Theoretically, this should never be shown to the user, so should we just copy the value we have for NSLocationWhenInUseUsageDescription? (I'm not sure Apple will accept that.) Is there a change we can make to remove the requirement for this?
  • If this is a red herring and NSLocationAlwaysAndWhenInUseUsageDescription isn't actually required for this plugin, can it be removed from the README?

Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions