Skip to content

Permissions

Midori edited this page Jan 12, 2024 · 43 revisions

Overview

iOS requires additional permissions to save to an album. You should make sure it is worth it.

Android iOS and macOS Windows
Just put WRITE_EXTERNAL_STORAGE NSPhotoLibraryAddUsageDescription or NSPhotoLibraryUsageDescription (limited, all) _
Put to album ur app created (will create) WRITE_EXTERNAL_STORAGE NSPhotoLibraryUsageDescription (limited, all) _
Put to album created by users or other apps ❌ NSPhotoLibraryUsageDescription (all) _

In iOS and macOS, it is not possible to save media to an album using only NSPhotolibraryAddUsageDescription. This is a swift limitation. If you have any complaints, please make a request to swift.

Gal.hasAccess(toAlbum: true) returns true when NSPhotoLibraryUsageDescription is limited or all. If you want to put media in an album created by users or other apps, you should avoid using Gal.hasAccess for confirmation.

🚨 If you try to save media in an album created by users or other apps with NSPhotoLibraryUsageDescription set to limited, gal will create a new album since it cannot reference that album.

Settings

Here we will only discuss the versions supported by the latest Flutter stable (Android >= 21, iOS >= 11).
Also, there may be changes in the specifications.

Android

In Android <23, Write permissions to the gallery app are allowed by default.

In Android >=23 && <=29, Writing to the gallery app requires the explicit statement
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" /> in the AndroidManifest.xml.

In Android >29, Write permissions to the gallery app are allowed by default.

Docs

iOS and macOS

In iOS >=11, Write permissions to the gallery app requires the explicit statement
<key>NSPhotoLibraryUsageDescription</key> in the info.plist.

In iOS >=14 and macOS , Apple's "Enhanced Privacy Experience" recommends using <key>NSPhotLibraryAddUsageDescription</key> for write-only.

Even for write-only use, <key>NSPhotoLibraryUsageDescription</key> is required to save to an album.

Docs

Dialogs

Android

Talks about the version to which access is not granted by default (Android >=23 && <29).
It will appear until the user checks the "Never show again" box in the dialog
and chooses to reject it, or until the user chooses to reject it from the app settings.

iOS and macOS

Due to Apple restrictions, it can basically only be displayed once.

Docs