Skip to content

Photos

Provides access to your photo library.

In order to read from your photo library, you must grant the app access to your photo library. The first time you use the APIs, the app will prompt for access but if you deny the request, all API calls will fail. In that case you must enable access to the photo library from the system settings.

Opens the camera for taking an image.

static fromCamera(): Promise<Image>

Use this for taking a new image using the camera.

Promise<Image>

Promise that provide the captured image when fulfilled.

Presents the photo library for picking an image.

static fromLibrary(): Promise<Image>

Use this for picking an image from the photo library.

Promise<Image>

Promise that provide the selected image when fulfilled.

Get latest photo.

static latestPhoto(): Promise<Image>

Reads the latest photo from your photo library. If no photo is available, the promise will be rejected.

Promise<Image>

Promise that provides the photo when fulfilled.

Get latest photos.

static latestPhotos(count: number): Promise<[Image]>

Reads the latests photos from your photo library. If no photo is available, the promise will be rejected.

count number

Number of photos to fetch.

Promise<[Image]>

Promise that provides the photos when fulfilled.

Get latest screenshot.

static latestScreenshot(): Promise<Image>

Reads the latest screenshot from your photo library. If no screenshot is available, the promise will be rejected.

Promise<Image>

Promise that provides the screenshot when fulfilled.

Get latest screenshots.

static latestScreenshots(count: number): Promise<[Image]>

Reads the latests screenshots from your photo library. If no screenshot is available, the promise will be rejected.

count number

Number of screenshots to fetch.

Promise<[Image]>

Promise that provides the screenshots when fulfilled.

Removes latest photo.

static removeLatestPhoto()

Before removing the photo, an alert is shown prompting you to confirm the removal.

Removes latest photos.

static removeLatestPhotos(count: number)

Before removing the photos, an alert is shown prompting you to confirm the removal.

count number

Number of photos to remove.

Removes latest screenshot.

static removeLatestScreenshot()

Before removing the screenshot, an alert is shown prompting you to confirm the removal.

Removes latest screenshots.

static removeLatestScreenshots(count: number)

Before removing the screenshots, an alert is shown prompting you to confirm the removal.

count number

Number of screenshots to remove.

Save an image.

static save(image: Image)

Saves the image to the photo library.

image Image

The image to save.