public class CameraRollManager extends ReactContextBaseJavaModule
NativeModule that allows JS to interact with the photos on the device (i.e.
MediaStore.Images).NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static boolean |
IS_JELLY_BEAN_OR_LATER |
METHOD_TYPE_REMOTE, METHOD_TYPE_REMOTE_ASYNC| Constructor and Description |
|---|
CameraRollManager(ReactApplicationContext reactContext) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getConstants() |
java.lang.String |
getName() |
void |
getPhotos(ReadableMap params,
Promise promise)
Get photos from
MediaStore.Images, most recent first. |
void |
saveImageWithTag(java.lang.String uri,
Promise promise)
Save an image to the gallery (i.e.
|
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getMethods, initialize, onCatalystInstanceDestroy, writeConstantsFieldpublic CameraRollManager(ReactApplicationContext reactContext)
public java.lang.String getName()
require() this module
from javascript.public java.util.Map<java.lang.String,java.lang.Object> getConstants()
getConstants in class BaseJavaModulepublic void saveImageWithTag(java.lang.String uri,
Promise promise)
MediaStore.Images). This copies the original file
from wherever it may be to the external storage pictures directory, so that it can be scanned
by the MediaScanner.uri - the file:// URI of the image to savepromise - to be resolved or rejectedpublic void getPhotos(ReadableMap params, Promise promise)
MediaStore.Images, most recent first.params - a map containing the following keys:
getPhotos(com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Promise)
promise - the Promise to be resolved when the photos are loaded; for a format of the
parameters passed to this callback, see getPhotosReturnChecker in CameraRoll.js