I want to use camera to send photos like other chat app does.
after a little workaround, I found a solution;
Thanks @FaridSafi for a great module
please share your solution so others can get the benfits
Added 3rd option in CustomActions
const options = ['Choose From Library', 'Send Location','Camera' ,'Cancel'];
I used another module.
var ImagePicker = require('react-native-image-picker');
added 3rd Case in Switch statement
case 2:
ImagePicker.launchCamera({title:"Please click photo"}, (response) => {
this.props.onSend([{
image: response.uri,
}]);
this.setImages([]);
});
break;
ImagePicker.launchCamera will not work in simulator
@riteshvish How did you call "CustomActions.js" from "App.js" file. Can you show your "App.js" file? Or What actually you did to your code to integrate Camera Feature.
@sachinsinghh
import CustomActions from './chat/CustomActions'; (your file path);
renderCustomActions(props) {
return (
/>
);
}
renderActions={this.renderCustomActions}
...
/>
@riteshvish Thanx
Most helpful comment
please share your solution so others can get the benfits