Install on macOS
Minimum deployment target
In order to use the location
plugin, you need to set your minimum deployment
target to macOS 11.0 or later:
platform :osx, '11.0'
Info.plist
In order to request location permissions, you need to add the following to your
macos/Runner/Info.plist
:
<key>NSLocationWhenInUseUsageDescription</key>
<string>The app needs the location</string>
The string will appear in the popup when the user is asked to grant location permissions.
Sandboxed application
Ensure that the application is properly "sandboxed" and that the location is enabled. You can do this in Xcode with the following steps:
- In the project navigator, click on your application's target. This should bring up a view with tabs such as "General", "Capabilities", "Resource Tags", etc.
- Click on the "Signing and Capabilities" tab. This will give you a list of items such as "App Groups", "App Sandbox", and so on. Each item will have an "On/Off" button.
- Turn on the "App Sandbox" item and press the ">" button on the left to show the sandbox informations.
- In the "App Data" section, select "Location".