Create a new app

The setup

The docs don’t bring this up at all, but there are two things needed to get access to device’s camera roll:

declare photo library usage

link the RCTCameraRoll library

Photo library usage declaration

In order to access user’s private data on iOS, like location, camera roll, contacts, etc, the application has to get the user’s permission.

For that, the application metadata has to list the reason why it needs a particular permission.
Without this, no prompt will be shown, and the application will crash when trying to access the private data.

To use the camera roll, Privacy - Photo Library Usage Description, or NSPhotoLibraryUsageDescription, should be set.

To set it, first open the Xcode project:

open ios/CameraRollPicker.xcodeproj

Then, select CameraRollPicker in the left sidebar, and go to the Info tab.

You should see a screen like this:

Under Custom iOS Target Properties, hover over any item, say Bundle name and click the plus icon.
In a new row, click the selector arrows and select Privacy - Photo Library Usage Description.

In the Value column, enter the text description of why the camera roll is needed.
For example, We need access to photos as it's the core app experience.

Whew! That wasn’t so hard!

Link the RCTCameraRoll library

React Native provides the ImagePickerIOS API which we are going to use.

To actually use it, though, the RCTCameraRoll native library is needed, and this is not documented.
It comes with React Native, but by default, it is not included in the project.