How to save photos to the camera roll in your Expo app, in short
Use expo-media-library. Install it with npx expo install expo-media-library and add it to the plugins array in app.json with a clear permission message. Then, when the user taps Save to Photos: ask for write access, make sure the image is a local file, and call Asset.create(fileUri). The photo lands in the user's library and you get back an Asset with an id you can keep.
This is the feature behind every Save button in a photo editor, a meme maker, a QR code generator, a receipt app or an AI image app. It is a few lines of code. What trips people up is that the API changed recently, that the function needs a file on the device rather than a web URL, and that the default Android setup asks for more access than a save button needs.
Step 1: Install expo-media-library and set the permission messages
- Install: npx expo install expo-media-library. Using expo install picks the version that matches your SDK.
- Add the config plugin to app.json: "plugins": [["expo-media-library", { "photosPermission": "Allow $(PRODUCT_NAME) to show your photos so you can pick one to edit.", "savePhotosPermission": "Allow $(PRODUCT_NAME) to save your edited images to Photos.", "granularPermissions": ["photo"] }]].
- photosPermission sets NSPhotoLibraryUsageDescription, the message for reading the library. savePhotosPermission sets NSPhotoLibraryAddUsageDescription, the message for add-only access. If your app only saves, the add-only message is the one the user actually sees.
- granularPermissions is Android only. It decides which of READ_MEDIA_IMAGES, READ_MEDIA_VIDEO and READ_MEDIA_AUDIO go into the Android manifest. The default is all three, so set it to ["photo"] if you only deal with images. More on why in Step 5.
- Make a new build. The module is included in Expo Go, so you can try the code there, but your own permission messages and plugin options only take effect in a development or production build.
Our take: write the message about the feature, not the API. Allow $(PRODUCT_NAME) to save your edited images to Photos tells the user exactly what will happen. The default, Allow $(PRODUCT_NAME) to save photos, is vague, and a vague prompt is an easy one to deny. Our [guide to requesting permissions in Expo](/blog/how-to-request-permissions-in-your-expo-app) covers how plugins write these strings during a build, and our [Expo Go vs development build](/blog/expo-go-vs-development-build) post explains when you need the second one.
Step 2: Ask for write-only access at the moment of saving
Most apps that save images never need to read the user's photo library. They need to put one image into it. That is what write-only access is for. Request it by passing true as the first argument: const { granted } = await MediaLibrary.requestPermissionsAsync(true, ['photo']). Inside a component you can use the hook instead: const [permission, requestPermission] = MediaLibrary.usePermissions({ writeOnly: true, granularPermissions: ['photo'] }).
Which access each job needs
| What you want to do | Access to ask for | iOS message used |
|---|---|---|
| Save an image or video the app made | Write-only | savePhotosPermission (NSPhotoLibraryAddUsageDescription) |
| Let the user pick a photo to upload or edit | None: use expo-image-picker instead | None for the picker itself |
| Show your own gallery grid of the user's photos | Full | photosPermission (NSPhotoLibraryUsageDescription) |
| Save into a named album, like your app's name | Full (you look up albums by title) | photosPermission |
The granularPermissions argument only has an effect on Android 13 and newer, so passing ['photo'] is harmless on iOS. Ask when the user taps Save, not on launch. A prompt that appears right after the user asked to save their image makes sense to them. One that appears on the splash screen gets denied. The response has a canAskAgain flag; when it is false, the system will not show the prompt again, so show a short note with a button that opens Settings instead.
If you only need the user to choose a photo, you do not need this module at all. Our [image picker guide](/blog/how-to-add-an-image-picker-to-your-expo-app) covers expo-image-picker, which opens the system photo picker without any library permission on iOS.
Step 3: Save the file with Asset.create
Call const asset = await Asset.create(fileUri). It takes a local file URI, such as file:///.../edited.jpg, creates a new asset in the media library from it, and resolves to an Asset. asset.id identifies the photo, so store it if you want to show it, find it or delete it later. Asset.create also takes an optional second argument: an Album to add the new asset to.
Where does the local file come from? Usually from somewhere else in your app: the uri from a camera capture, the result of an image edit, a file you wrote with expo-file-system, or a PDF or image your app generated. Our [camera guide](/blog/how-to-add-a-camera-to-your-expo-app) covers takePictureAsync, which writes to the app's cache directory. That cache file is temporary, so saving it to Photos with Asset.create is exactly what turns a capture into something the user keeps.
- Wrap the call in try/catch and show a clear Saved to Photos or Could not save message. Users tap Save and then go check, so the confirmation matters.
- Disable the button while the save is running so a double tap does not create two copies.
- For several images, create them one after another in a loop and show progress, rather than firing them all at once.
Step 4: Save an image from a URL
Asset.create needs a file on the device, so a remote URL from your server or an AI image API has to be downloaded first. With the current expo-file-system API that is two lines: const file = new File(Paths.cache, 'download.jpg'), then await File.downloadFileAsync(url, file). Pass file.uri to Asset.create. File and Paths are imported from 'expo-file-system'.
- Give each download a unique filename, for example based on the image id, so a second save does not collide with an old cached file.
- Download inside the same try/catch as the save, and only report success after Asset.create resolves.
Want to save a screen of your app as an image, like a generated certificate or a stats card? That is a two-step job: capture the view to a file with a view-capture library such as react-native-view-shot, then pass the resulting file URI to Asset.create the same way.
Step 5: Albums, limited access and the Android permission trap
Albums. To keep your app's images together, find or create an album by name: let album = await Album.get('My App'); if it is null, call Album.create('My App', [asset]). Otherwise pass the album as the second argument to Asset.create, or call album.add(asset). On Android, Album.create moves the assets into the new album by default; pass false as the third argument to copy them instead. Our take: albums are a nice touch for apps that save a lot, but they need full access, so do not add them to an app that saves the odd image.
Limited access. When you request full access, the response includes accessPrivileges: 'all', 'limited' or 'none'. Limited means the user only shared selected photos, which is available on iOS 14+ and Android 14+. If your gallery screen looks empty, check this first, and offer a button that calls MediaLibrary.presentPermissionsPicker() so the user can share more. It only shows the system picker when access is limited and does nothing otherwise.
The Android trap. Google Play policy says apps targeting Android 13 or later may only request READ_MEDIA_IMAGES and READ_MEDIA_VIDEO when a system picker is not enough for the app's core function, and apps that do request them must submit a declaration in Play Console explaining why. Full compliance became mandatory on May 28, 2025. Because the expo-media-library plugin adds all three READ_MEDIA permissions by default, a simple Save to Photos button can put you in that review. Set granularPermissions to only what you use, check the merged manifest of your build, and use the image picker for anything that only needs the user to choose a photo.
Have Claude Code build it for you
Open your project in the Claude Code desktop app and be specific, because AI-written code for this feature very often uses MediaLibrary.saveToLibraryAsync or createAssetAsync (which now throw), passes a remote URL straight in, and requests full library access on launch. A prompt that avoids all three:
Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "Saving to Photos goes through src/lib/saveToPhotos.ts; expo-media-library object API, write-only access, Asset.create with a local file" so a later session keeps the rules. Our guide to [debugging an Expo app on a device](/blog/how-to-debug-expo-app-on-device) covers getting a development build onto a phone. If your app is on an older SDK, our [Expo SDK upgrade guide](/blog/how-to-upgrade-your-expo-sdk-version) covers moving forward, and the legacy import keeps old save code running while you port it.
The short version
To save photos to the camera roll in your Expo app: install expo-media-library, set a specific savePhotosPermission message and granularPermissions in the config plugin, and make a build. Request write-only access when the user taps Save, download remote images to the cache first, and call Asset.create with the local file. Use albums only when the app saves a lot, and keep the Android permissions down to what the feature uses.
If you are building your first iOS app with Claude Code and Expo and want feedback on it before App Review, bring it to App Store Launch Club. Members share their builds and help each other get unstuck, and the [curriculum](/curriculum) covers the full path from first build to first users. If you are adding more native features, our guides to the [share sheet](/blog/how-to-add-a-share-sheet-to-your-expo-app) and [PDF generation](/blog/how-to-generate-a-pdf-in-your-expo-app) follow the same pattern. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
How do I save an image to the gallery in Expo?
Install expo-media-library, request write access with MediaLibrary.requestPermissionsAsync(true, ['photo']), then call Asset.create(fileUri) with a local file URI. The image is added to the user's photo library and you get back an Asset with an id.
Why does saveToLibraryAsync throw an error in Expo?
Since SDK 56, the function-style methods on the root expo-media-library import, including saveToLibraryAsync, createAssetAsync and createAlbumAsync, are deprecated and throw at runtime. Use Asset.create and Album.create from the current API, or import the old functions from expo-media-library/legacy.
Can I save an image from a URL with expo-media-library?
Not directly. Asset.create needs a local file URI, so download the image first, for example with File.downloadFileAsync from expo-file-system into Paths.cache, and then pass the downloaded file's uri to Asset.create.
Do I need full photo library permission just to save a photo?
No. Request write-only access by passing true as the first argument to requestPermissionsAsync, or writeOnly: true to usePermissions. On iOS that uses the add-only permission, whose message comes from savePhotosPermission (NSPhotoLibraryAddUsageDescription).
Does expo-media-library work in Expo Go?
Yes, it is included in Expo Go, so you can try the code there. Your own permission messages and config plugin options, such as granularPermissions, only take effect in a development or production build.
How do I save photos to a custom album in Expo?
Look up the album with Album.get('Album Name'). If it returns null, create it with Album.create('Album Name', [asset]). Otherwise pass the album as the second argument to Asset.create or call album.add(asset). On Android, Album.create moves assets into the album by default; pass false as the third argument to copy them.
Will expo-media-library cause a Google Play permissions review?
It can. By default its config plugin adds READ_MEDIA_IMAGES, READ_MEDIA_VIDEO and READ_MEDIA_AUDIO to the Android manifest, and Google Play only allows READ_MEDIA_IMAGES and READ_MEDIA_VIDEO for apps whose core function needs broad photo access, with a Play Console declaration. Set granularPermissions to only what you use and use the image picker for photo selection.
Last reviewed by David on October 31, 2026

