You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8055955
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: reason-react-native/src/apis/CameraRoll.md
+25-11Lines changed: 25 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,43 +5,57 @@ title: CameraRoll
5
5
6
6
## Methods
7
7
8
-
-`saveToCameraRoll` allows saving photos and videos to the Camera Roll or Photo Gallery. File to be saved is specified as a tag which can be
8
+
-`saveToCameraRoll` allows saving photos and videos to the Camera Roll or Photo
9
+
Gallery. File to be saved is specified as a tag which can be
9
10
10
-
- on Android, a local image or video URI, such as "file:///sdcard/img.png"
11
-
- on iOS, a local video URI or any image URI (local, remote asset-library, or base64 data URIs)
11
+
- on Android, a local image or video URI, such as "file:///sdcard/img.png"
12
+
- on iOS, a local video URI or any image URI (local, remote asset-library, or
13
+
base64 data URIs)
12
14
13
-
Media type (photo or video) will be automatically inferred; any file will be inferred to be a photo, unless the file extension is `mov` or `mp4`, then it will be inferred to be a video.
15
+
Media type (photo or video) will be automatically inferred; any file will be
16
+
inferred to be a photo, unless the file extension is `mov` or `mp4`, then it
17
+
will be inferred to be a video.
14
18
15
19
```reason
16
20
saveToCameraRoll(tag)
17
21
```
18
22
19
-
The function will return the URI for the saved file as a string wrapped in a Promise, `Js.Promise.t(string)`.
23
+
The function will return the URI for the saved file as a string wrapped in a
24
+
Promise, `Js.Promise.t(string)`.
20
25
21
-
-`saveToCameraRollWithType` allows saving photos and videos to the Camera Roll, where the tag will be specified as above, overriding the automatically determined type.
26
+
-`saveToCameraRollWithType` allows saving photos and videos to the Camera Roll,
27
+
where the tag will be specified as above, overriding the automatically
28
+
determined type.
22
29
23
30
```reason
24
31
saveToCameraRollWithType(tag, _type)
25
32
```
26
33
27
34
where `_type` can be `` `photo `` or `` `video ``.
28
35
29
-
The function will return the URI for the saved file as a string wrapped in a Promise, `Js.Promise.t(string)`.
36
+
The function will return the URI for the saved file as a string wrapped in a
37
+
Promise, `Js.Promise.t(string)`.
30
38
31
39
-`getPhotos` takes as argument `getPhotosParams`
32
40
33
41
```reason
34
42
getPhotos(getPhotosParams)
35
43
```
36
44
37
-
The function will return a `photoIdentifiersPage` object wrapped in a Promise, that is `Js.Promise.t(photoIdentifiersPage)`. Array of `photoIdentifier` will contain details of photos or videos matching parameters provided in the `getPhotosParam` object.
38
-
45
+
The function will return a `photoIdentifiersPage` object wrapped in a Promise,
46
+
that is `Js.Promise.t(photoIdentifiersPage)`. Array of `photoIdentifier` will
47
+
contain details of photos or videos matching parameters provided in the
48
+
`getPhotosParam` object.
39
49
40
50
## Types
41
51
42
52
-`getPhotosParams` can be constructed with the constructor of the same name
43
-
-`first` takes an integer which specifies the number of files for which details will be returned. Files will match in reverse order (i.e. most recent first)
44
-
-`after` takes a string which should be obtained from `photoIdentifiersPage` returned in a previous `getPhotos` call, under the `end_cursor` key contained in turn under the `page_info` key.
53
+
-`first` takes an integer which specifies the number of files for which
54
+
details will be returned. Files will match in reverse order (i.e. most
55
+
recent first)
56
+
-`after` takes a string which should be obtained from `photoIdentifiersPage`
57
+
returned in a previous `getPhotos` call, under the `end_cursor` key
0 commit comments