CameraRoll
provides access to the local camera roll or photo library.
On iOS
, the CameraRoll
API requires the RCTCameraRoll
library to be linked
You can read more on CameraRoll
API usage in official docs: https://facebook.github.io/react-native/docs/cameraroll
Types
cursor
type cursor;
node
type node = {
.
"_type": string,
"group_name": string,
"image": {
.
"filename": string,
"height": int,
"isStored": bool,
"playableDuration": int,
"uri": string,
"width": int,
},
"location": {
.
"altitude": float,
"heading": float,
"latitude": float,
"longitude": float,
"speed": float,
},
"timestamp": float,
};
assets
type assets = {
.
"edges": array({. "node": node}),
"page_info": {
.
"end_cursor": cursor,
"has_next_page": bool,
"start_cursor": cursor,
},
};
filetype
type fileType =
| Video
| Photo;
groupType
type groupType =
| All
| Album
| Event
| Faces
| Library
| PhotoStream
| SavedPhotos;
assetType
type assetType =
| All
| Videos
| Photos;
Methods
saveToCameraRoll
let saveToCameraRoll:
(~uri: string, ~type_: fileType=?, unit) =>
Js.Promise.t(Belt.Result.t(string, Js.Promise.error));
getPhotos
let getPhotos:
(
~first: int,
~after: cursor=?,
~groupTypes: groupType=?,
~groupName: string=?,
~assetType: assetType=?,
~mimeTypes: string=?,
unit
) =>
Js.Promise.t(assets);