7

I would like the user to select an Album and then display the photos of it in react-native. There is the CameraRoll and it has the ability to filter by groupName, but I did not find a way of how to retrieve these groupNames. Does anybody know how to do this, or do I need to write a native plugin?

Patrick Klitzke
  • 1,519
  • 2
  • 14
  • 24

4 Answers4

1

well, at least you can select a lot of items and group...

import R from 'ramda';
import { CameraRoll } from 'react-native';
let groupNames;
CameraRoll.getPhotos({
    first:20000
}).then(
    (result) => {
        const groupNamesAr = R.map(
            (item) => {
                return item.node.group_name;
            }
        )(result.edges)
        groupNames = R.countBy((i)=>i)(groupNamesAr);
    }
)
Bruno Reis
  • 326
  • 2
  • 7
0

Use this https://github.com/marcshilling/react-native-image-picker it will let you select an image from any album.

Computer's Guy
  • 5,122
  • 8
  • 54
  • 74
0

I don't think this is currently possible. See this issue in the official repository. You can upvote this feature request if you're looking for this to be implemented.

-1

Simple answer is MediaLibrary.getAlbumsAsync()

x-magix
  • 2,623
  • 15
  • 19