Call iOS / macOS startAccessingSecurityScopedResource
and stopAccessingSecurityScopedResource
in Flutter.
final _plugin = AccessingSecurityScopedResource();
final folderPath = /* Get a folder path */;
// Get access.
final hasAccess = await _plugin.startAccessingSecurityScopedResourceWithFilePath(folderPath);
// Release access.
_plugin.stopAccessingSecurityScopedResourceWithFilePath(folderPath);
URL-based APIs:
startAccessingSecurityScopedResourceWithURL
stopAccessingSecurityScopedResourceWithURL