PhotosPlugin

createAlbum

createAlbum(options: PhotosCreateAlbumOptions): Promise<void>
Create an album in the user's photo library
options PhotosCreateAlbumOptions
Returns: Promise<void>

getAlbums

getAlbums(options?: PhotosAlbumsFetchOptions): Promise<PhotosAlbumsResult>
Get albums from the user's photo library
options PhotosAlbumsFetchOptions
Returns: Promise<PhotosAlbumsResult>

getPhotos

getPhotos(options?: PhotosFetchOptions): Promise<PhotosResult>
Get photos from the user's photo library
options PhotosFetchOptions
Returns: Promise<PhotosResult>

savePhoto

savePhoto(options?: PhotosSaveOptions): Promise<PhotosSaveResult>
Save a photo the the user's photo library
options PhotosSaveOptions
Returns: Promise<PhotosSaveResult>

addListener

addListener(eventName: string, listenerFunc: Function): PluginListenerHandle
eventName string
listenerFunc Function
Returns: PluginListenerHandle

Interfaces Used

PhotosCreateAlbumOptions

interface PhotosCreateAlbumOptions {
name : string;
}

PhotosAlbumsFetchOptions

interface PhotosAlbumsFetchOptions {
// Whether to load cloud shared albums
loadShared : boolean;
}

PhotosAlbumsResult

interface PhotosAlbumsResult {
// The list of albums returned from the query
albums : PhotosAlbum[];
}

PhotosFetchOptions

interface PhotosFetchOptions {
// Which album identifier to query in (get identifier with getAlbums())
albumIdentifier ?: string;
// The number of photos to fetch, sorted by last created date descending
quantity ?: number;
// The height of thumbnail to return
thumbnailHeight ?: number;
// The quality of thumbnail to return as JPEG (0-100)
thumbnailQuality ?: number;
// The width of thumbnail to return
thumbnailWidth ?: number;
// Which types of assets to return (currently only supports "photos")
types ?: string;
}

PhotosResult

interface PhotosResult {
// The list of photos returned from the library
photos : PhotoAsset[];
}

PhotosSaveOptions

interface PhotosSaveOptions {
// The optional album identifier to save this photo in
albumIdentifier ?: string;
// The base64-encoded JPEG data for a photo (note: do not add HTML data-uri type prefix)
data : string;
}

PhotosSaveResult

interface PhotosSaveResult {
// Whether the photo was created
success : boolean;
}