How to `createAssetAsync` and move it with `addAssetsToAlbumAsync` without asking permission


I’m faced with a problem : I can’t add an image to an album, without create a duplicate or requesting permission to remove the old image.

My steps:

  1. capture a picture with ImagePicker.launchCameraAsync()
  2. create an asset with MediaLibrary.createAssetAsync(uri)
  3. move the asset to an album with MediaLibrary.addAssetsToAlbumAsync([asset], album, false). The false arg is to move, not copy

Because I want the asset to be moved and not duplicated, the third step ask user for permission to delete the old asset.

We can’t call MediaLibrary.addAssetsToAlbumAsync directly with an uri, we have to create an asset. So to move/remove this asset, permission is asked.

Am I the only one who wants to do this?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.