ionic-team / capacitor-docs

https://capacitorjs.com/docs
Apache License 2.0
20 stars 196 forks source link

NSLocationAlwaysUsageDescription - Deprecated #246

Closed co-dax closed 6 months ago

co-dax commented 7 months ago

https://capacitorjs.com/docs/apis/geolocation The URL at which the content is missing or inaccurate

What is missing or inaccurate about the content on this page? It is indicating to add NSLocationAlwaysUsageDescription (Privacy - Location Always Usage Description) to Info.plist but NSLocationAlwaysUsageDescription is deprecated since ios 11 as stated here https://developer.apple.com/documentation/bundleresources/information_property_list/nslocationalwaysusagedescription and at the same Apple page it is suggesting to use NSLocationAlwaysAndWhenInUseUsageDescription. The same suggestion is made at the related cordova location plugin NSLocationAlwaysUsageDescription describes the reason that the app is requesting access to the user's location at all times. Use this key if your app accesses location information in the background and you deploy to a target earlier than iOS 11. For iOS 11 and later, add both NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription to your app’s Info.plist file with the same message..

NSLocationAlwaysUsageDescription is deprecated since ios 11 and Capacitor minimum required iOS version is 13.

Am I missing something?

Thanks.

co-dax commented 7 months ago

...by the way the same applies to the documentation for @capacitor/google-maps plugin at the following link https://capacitorjs.com/docs/apis/google-maps#ios. Here the relevant excerpt: NSLocationAlwaysUsageDescription (Privacy - Location Always Usage Description).

jcesarmobile commented 6 months ago

Apis docs come directly from the plugins README, it's been fixed there already, but for Capacitor 6 docs only.

co-dax commented 6 months ago

Thanks @jcesarmobile.

Is it also safe to only have NSLocationWhenInUseUsageDescription in Info.plist for @capacitor/geolocation and @capacitor/google-maps in the case of Capacitor 5? I mean, can we omit NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription and only have NSLocationWhenInUseUsageDescription in Info.plist for these plugins?

Thanks!

jcesarmobile commented 6 months ago

Yes, it's also possible, we marked it as "breaking" just to document it in the upgrade guide so all users who update from Capacitor 5 to Capacitor 6 can know about it, but you can do it now.

co-dax commented 6 months ago

Thanks @jcesarmobile !