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,
Callback success,
Callback error)
Get photos from
MediaStore.Images, most recent first. |
void |
saveImageWithTag(java.lang.String uri,
Callback success,
Callback error)
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,
Callback success,
Callback error)
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 savesuccess - callback to be invoked on successful save to gallery; the only argument passed
to this callback is the MediaStore content:// URI of the new image.error - callback to be invoked on error (e.g. can't copy file, external storage not
available etc.)public void getPhotos(ReadableMap params, Callback success, Callback error)
MediaStore.Images, most recent first.params - a map containing the following keys:
getPhotos(com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Callback, com.facebook.react.bridge.Callback)
success - the callback to be called when the photos are loaded; for a format of the
parameters passed to this callback, see getPhotosReturnChecker in CameraRoll.jserror - the callback to be called on error