简体   繁体   中英

NSLocationWhenInUseUsageDescription inside library Info.plist

I've built a Swift library that uses CoreLocation for fetching user location when the app is in use. If I want to integrate my library inside an app, I only need to import the library, instantiate my class and start the method that gets user location...

...And I also need to add NSLocationWhenInUseUsageDescription inside the app Info.plist!

I was wondering if it is possible to add the NSLocationWhenInUseUsageDescription inside the library Info.plist to let the programmer choose if implement a custom description or leave the default library description.

PS I've already added the NSLocationWhenInUseUsageDescription inside the library Info.plist, but Xcode is not happy if I decide not to add it also in the app Info.plist:

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data

Thanks a lot in advance!

No, this is not possible.

You will need to instruct the library user that they need to add the location usage key to their app's info.plist.

They will need to add a description that is appropriate for their app's usage of location

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM