WidgetKit with CLLocationManager

Hi!

I'm having issues trying to use the CLLocationManager with the Widget I'm building.

Despite having, the keys: NSLocationUsageDescription and NSLocationWhenInUseUsageDescription both of them with a proper description.

I till get an stdout message:

This widget has attempted to access privacy-sensitive data without specifying a need. The widget's Info.plist must contain a “NSLocationUsageDescription” key with any number other than 0

Is there anything I can do?


Answered by developer555 in 617381022
You need to add the NSWidgetWantsLocation entry to your plist. This is mentioned in one of the talks about location this year.
Same issue here. I've ensured that I have the appropriate entries in both my iOS app and the widget's info.plist file. It works fine in the app, but I get the same error for the widget. It feels like a bug with WidgetKit, and if necessary, I'm happy to file a bug report.
I have come across this issue as well.

I have added NSLocationUsageDescription to the info.plist for the Widget, though Xcode still yells: "The widget's Info.plist must contain a “NSLocationUsageDescription” key with any number other than 0".

Works fine on iPhone, iPad and macOS app.
I have had this issue, and it does seem like a bug.
You need to add the NSWidgetWantsLocation entry to your plist. This is mentioned in one of the talks about location this year.
WidgetKit with CLLocationManager
 
 
Q