Photos
The Photos API provides methods to load photos and albums from the user's photo library, along with saving photos.
API
getPhotos(...)
getPhotos(options?: PhotosFetchOptions) => Promise<PhotosResult>
Get photos from the user's photo library
Param | Type |
---|---|
options | PhotosFetchOptions |
Returns: Promise<PhotosResult>
getAlbums(...)
getAlbums(options?: PhotosAlbumsFetchOptions) => Promise<PhotosAlbumsResult>
Get albums from the user's photo library
Param | Type |
---|---|
options | PhotosAlbumsFetchOptions |
Returns: Promise<PhotosAlbumsResult>
savePhoto(...)
savePhoto(options?: PhotosSaveOptions) => Promise<PhotosSaveResult>
Save a photo the the user's photo library
Param | Type |
---|---|
options | PhotosSaveOptions |
Returns: Promise<PhotosSaveResult>
createAlbum(...)
createAlbum(options: PhotosCreateAlbumOptions) => Promise<void>
Create an album in the user's photo library
Param | Type |
---|---|
options | PhotosCreateAlbumOptions |
Interfaces
PhotosResult
Prop | Type | Description |
---|---|---|
photos | PhotoAsset[] | The list of photos returned from the library |
PhotoAsset
Prop | Type | Description |
---|---|---|
identifier | string | Platform-specific identifier |
data | string | Data for a photo asset as a base64 encoded string (JPEG only supported) |
creationDate | string | ISO date string for creation date of asset |
fullWidth | number | Full width of original asset |
fullHeight | number | Full height of original asset |
thumbnailWidth | number | Width of thumbnail preview |
thumbnailHeight | number | Height of thumbnail preview |
location | PhotoLocation | Location metadata for the asset |
PhotoLocation
Prop | Type | Description |
---|---|---|
latitude | number | GPS latitude image was taken at |
longitude | number | GPS longitude image was taken at |
heading | number | Heading of user at time image was taken |
altitude | number | Altitude of user at time image was taken |
speed | number | Speed of user at time image was taken |
PhotosFetchOptions
Prop | Type | Description |
---|---|---|
quantity | number | The number of photos to fetch, sorted by last created date descending |
thumbnailWidth | number | The width of thumbnail to return |
thumbnailHeight | number | The height of thumbnail to return |
thumbnailQuality | number | The quality of thumbnail to return as JPEG (0-100) |
types | string | Which types of assets to return (currently only supports "photos") |
albumIdentifier | string | Which album identifier to query in (get identifier with getAlbums()) |
PhotosAlbumsResult
Prop | Type | Description |
---|---|---|
albums | PhotosAlbum[] | The list of albums returned from the query |
PhotosAlbum
Prop | Type | Description |
---|---|---|
identifier | string | Local identifier for the album |
name | string | Name of the album |
count | number | Number of items in the album |
type | PhotosAlbumType | The type of album |