@felix-health/capacitor-save-media
v0.1.0
Published
Save images to the device photo library with write-only permissions
Downloads
315
Maintainers
Keywords
Readme
@felix-health/capacitor-save-media
Capacitor plugin to save images to the device photo library using write-only permissions.
This is an alternative to @capacitor-community/media which requires broad read permissions (READ_EXTERNAL_STORAGE, READ_MEDIA_IMAGES, READ_MEDIA_VIDEO) that may be rejected by the Google Play Store.
Permissions
| Platform | Permission | Why |
|----------|-----------|-----|
| Android < 10 | WRITE_EXTERNAL_STORAGE | Required to write to external storage on API < 29 |
| Android 10+ | None | MediaStore writes are permission-free under scoped storage |
| iOS 16+ | NSPhotoLibraryAddUsageDescription | Add-only access — does not request read access |
Install
npm install @felix-health/capacitor-save-media
npx cap syncUsage
import { SaveMedia } from '@felix-health/capacitor-save-media'
await SaveMedia.saveImage({ url: 'https://example.com/image.png' })API
saveImage(options)
Downloads the image at the given URL and saves it to the device photo library.
| Param | Type | Description |
|-------|------|-------------|
| url | string | The URL of the image to save |
Returns: Promise<void>
Throws if the URL is invalid, the download fails, or photo library permission is denied.
License
MIT
