2

I want to use CameraRoll in my react native application. I've tryed to install it doing :

npm install RCTCameraRoll --save

but i get :

npm ERR! 404

what is the proper way to do it ?

1 Answer 1

1

Having just spent two hours on this, it's apparently still confusing nine months after your question.

The official documentation (https://facebook.github.io/react-native/docs/cameraroll.html) points to the linking page which suggests that there's a package to install (which it points out must be referred to in package.json for automatic linking).

RCTCameraRoll is already included in your react-native npm installation (node_modules/react-native/Libraries/CameraRoll). So no need to npm it.

However it's not linked in your Xcode project, so you have to follow the instructions in https://facebook.github.io/react-native/docs/linking-libraries-ios.html for manual linking.

And what about Android? That's not mentioned in the manual linking instructions. No linking seems to be required. import {CameraRoll} from react-native is all that's necessary.

Sign up to request clarification or add additional context in comments.

5 Comments

Wow so much of inconsistency , this is one of the reasons not to consider RN for serious and big projects .
and in latest modules I can see no Xcode project anyways, so still no idea how to link it.
@vishaldharankar: railsware.com/blog/2017/10/09/… this is a list of all the successful projects by using RN. Are you sure about not to consider RN for serious and big projects?
@Isaac lets talk about regular tom , not insta , tesla etc. its hard to find info on certain topics like the above one, was it native I would have done dozens of time, by the time.
I couldn't find CameraRoll in the Libraries folder, so I found it in the react-native-community github. Please refer to instructions in github.com/react-native-community/react-native-cameraroll

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.