Monday 12 June 2017

swift - Core Location plist not working (Xcode 9.4/iOS 11.4)



Trying to do a base Core Location test in Xcode 9.4...



I have clearly missed something.



Have put in three entries into info.plist to allow Core Location to run:




  • Privacy - Location Always Usage Description


  • Privacy - Location Always and When In Use Usage Description

  • Privacy - Location when in Use Usage Description



The questions don't pop up on my iPhone 7 or the simulator when you run the App and there is no setting for the App under Settings/App Listings...



Do I need all three entries (paranoia) and if not which one(s) can I delete?
Any ideas what I've missed?



enter image description here



Answer



From screenshot I am getting that you have inserted strings to another plist file which is in UITests folder.



Insert that (NSLocationWhenInUseUsageDescription, NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription) strings to YOURPROJECT/YOURPROJECT/Info.plist



Also please select the simulated location while you are running your project in simulator.



Hope it will work.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...