-
Notifications
You must be signed in to change notification settings - Fork 59
macOS: Deal with App Sandbox
For macOS, Flutter app restricts its capability by enabling App Sandbox by default. You can change the behavior by editing your app's entitlements files depending on your configuration.
The easiest option to access files on your local storage (i.e. SSD or HDD), set com.apple.security.app-sandbox
to false on your entitlements file though it is not recommended for releasing apps because it completely disables App Sandbox.
Another option is to use com.apple.security.files.user-selected.read-only
along with file_selector_macos. The option is better in security than the previous option.
Anyway, the example code for the plugin illustrates how to download and preview internet hosted PDF file. It uses
com.apple.security.network.client
along with flutter_cache_manager:
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>