【问题标题】:Expo MediaLibrary ios smart albums not returningExpo MediaLibrary ios智能相册未返回
【发布时间】:2020-09-13 15:48:59
【问题描述】:

我尝试通过 EXPO MediaLibrary 获取所有专辑名称,但是 MediaLibrary.getAlbumsAsync() 仅返回用户创建的专辑。谁能建议您如何处理这种情况并获得 ios 智能相册?感谢您的支持和指导。

【问题讨论】:

    标签: expo media-library


    【解决方案1】:
    const isRecent = await MediaLibrary.getAlbumAsync('Recent')
    
    if (isRecent) {
        console.log('exist')
    } else {
        const allPhotos = await MediaLibrary.getAssetsAsync()
        const recentAlbum = await MediaLibrary.createAlbumAsync('Recent', {}) 
        await MediaLibrary.addAssetsToAlbumAsync(allPhotos.assets, recentAlbum)             
    }   
    

    我也无法获得智能相册。我尝试创建一个副本。

    但我认为这不是一种高效的方式。

    【讨论】:

      猜你喜欢
      • 2020-01-19
      • 1970-01-01
      • 2014-05-30
      • 1970-01-01
      • 2021-03-20
      • 1970-01-01
      • 1970-01-01
      • 2020-04-08
      • 2022-12-16
      相关资源
      最近更新 更多