react-native APIs
- View
- Text
- StyleSheet
- TouchableOpacity
- Image
- ScrollView
- Dimensions
- Platform
- TextInput
- FlatList
- StatusBar
- SafeAreaView
- Alert
- AppRegistry
- Animated
- ActivityIndicator
- KeyboardAvoidingView
- Button
- Linking
- Modal
- TouchableWithoutFeedback
- ImageBackground
- Keyboard
- TouchableHighlight
- NativeModules
- Easing
- BackHandler
- RefreshControl
- AsyncStorage
- ToastAndroid
- PanResponder
- AppState
- Switch
- PermissionsAndroid
- ViewPropTypes
- YellowBox
- TouchableNativeFeedback
- LayoutAnimation
- PixelRatio
- Share
- Vibration
- InteractionManager
- Picker
- LogBox
- SectionList
- I18nManager
- Pressable
- NativeEventEmitter
- UIManager
- DeviceEventEmitter
- findNodeHandle
- Clipboard
- Appearance
- useColorScheme
- Slider
- ActionSheetIOS
- useWindowDimensions
- CameraRoll
- requireNativeComponent
- PushNotificationIOS
- unstable_batchedUpdates
- VirtualizedList
- NetInfo
- Networking
- TVEventHandler
- processColor
- console
- TextPropTypes
- TouchableWithoutFeedbackProps
- TurboModuleRegistry
OtherRelated APIs
react-native#CameraRoll JavaScript Examples
The following examples show how to use
react-native#CameraRoll.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImageUtil.js From RRWallet with MIT License | 6 votes |
async function saveToCameraRoll(uri) {
if (!_.isString(uri) || uri.length <= 0) {
throw new Error(ERROR_MESSAGE_SAVE_IMAGE);
}
if (Platform.OS === "android") {
try {
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE);
if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
throw new Error(ERROR_MESSAGE_SAVE_IMAGE);
}
} catch (err) {
throw new Error(ERROR_MESSAGE_SAVE_IMAGE);
}
}
try {
await CameraRoll.saveToCameraRoll(uri);
} catch (error) {
throw new Error(ERROR_MESSAGE_SAVE_IMAGE);
}
}