SDK Version: 41
Platforms(Android/iOS/web/all): iOS
I’m trying to get assets inside the moment so I did like below.
const mediaType = [MediaLibrary.MediaType.photo, MediaLibrary.MediaType.video]
const albums = await MediaLibrary.getMomentsAsync()
albums.map(async album => {
const assets = await MediaLibrary.getAssetsAsync({ album, mediaType })
})
This will raise error.
backend.js:32 Possible Unhandled Promise Rejection (id: 247):
Error: Couldn't find album
Error: Couldn't find album
at Object.promiseMethodWrapper [as callMethod] (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:2765:36)
at Object.NativeModulesProxy.<computed>.<computed> [as getAssetsAsync] (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:99502:30)
at getAssetsAsync$ (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:281440:77)
at tryCatch (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29050:19)
at Generator.invoke [as _invoke] (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29223:24)
at Generator.next (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29093:23)
at tryCatch (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29050:19)
at invoke (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29123:22)
at http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:29153:13
at tryCallTwo (http://192.168.1.35:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:3953:7)
I also tried to pass the ID string as an album await MediaLibrary.getAssetsAsync({ album: album.id, mediaType })
but it still raises error.
I can get the assets from the normal albums (from MediaLibrary.getAlbumsAsync
) without any problem.
Is this a bug? or am I missing something?