Handle persistent URI permissions
mainOn Android and iOS, you can request persistent access to a picked file or directory by setting persistedUriPermission: true in pickDirectory(), pickFile(), pickFiles(), or createDirectory().
Workflow for Persistent URIs
- Request Permission: Use the
persistedUriPermission: trueflag when picking. - Store URI: Save the returned URI in a database for later use.
- Activate URI: When you need to use the stored URI in a future session, you must call
activate()to get a usable URI for the current session.
Platform Specifics
- Android: The URI is registered with the OS, allowing access in future sessions without re-prompting the user.
- iOS: Persistent URIs use the
urlbookmark://scheme. To access the actual file, you must callawait downloader.uri.activate(persistentUri), which returns a usablefile://URI for the current session.