3

可以使用相机胶卷获取照片,但可以通过智能相册过滤,例如:自拍、屏幕截图等。我试试这个:

CameraRoll.getPhotos({ groupName: 'Favorites', groupTypes: 'Library', first: 36 })
.then((data) => {
  const assets = data.edges;
  const images = assets.map((asset) => {
    console.log('Imagen', asset);
    return asset.node.group_name;
  });
  console.log('CameraRoll images', data, images);
})
.catch(err => console.log('CameraRoll error', err));

但总是返回一个空数组。

4

1 回答 1

0

这是不可能的,因为 react-native 使用 ALAssetsLibrary,我需要使用 Photos 框架,所以它是集成 react-native-photos-framework 的解决方案

https://github.com/olofd/react-native-photos-framework

于 2017-09-26T16:25:39.663 回答