Asset object extended by additional fields listed in the table.
Deletes assets from the library.
On iOS it deletes assets from all albums they belong to, while on Android it keeps all copies of them (album is strictly connected to the asset).
Also, there is additional dialog on iOS that requires user to confirm this action.
assets (array) -- An array of assets or their IDs.
Returns true if the assets were successfully deleted.
Creates an album with given name and initial asset.
The asset parameter is required on Android, since it's not possible to create empty album on this platform.
On Android, by default it copies given asset from the current album to the new one, however it's also possible to move it by passing false as copyAsset argument.
In case it's copied you should keep in mind that getAssetsAsync will return duplicated asset.
albumName (string) -- Name of the album to create.
asset (string | Asset) -- Asset or its ID. Required on Android.
copyAsset (boolean) -- Whether to copy asset to the new album instead of move it. Defaults to true. (Android only)
On Android by default it deletes assets belonging to given albums from the library. On iOS it doesn't delete these assets, however it's possible to do by passing true as deleteAssets.
albums (array) -- Array of albums or their IDs, that will be removed from the library.
deleteAssets (boolean) -- Whether to also delete assets belonging to given albums. Defaults to false. (iOS only)
Returns a promise resolving to true if the albums were successfully deleted from the library.
Expo.MediaLibrary.addAssetsToAlbumAsync(assets, album, copyAssets)
Adds array of assets to the album.
On Android, by default it copies assets from the current album to provided one, however it's also possible to move them by passing false as copyAssets argument.
In case they're copied you should keep in mind that getAssetsAsync will return duplicated assets.
listener (function) -- A callback that is called when any assets have been inserted or deleted from the library. On Android it's invoked with an empty object. On iOS it's invoked with an object that contains following keys:
insertedAssets (array) -- Array of assets that have been inserted to the library.
deletedAssets (array) -- Array of assets that have been deleted from the library.
An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener.