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.
Methods
Section titled “Methods”fromCamera()
Section titled “fromCamera()”Opens the camera for taking an image.
static fromCamera(): Promise<Image>Use this for taking a new image using the camera.
Return value
Section titled “Return value”Promise<Image>
Promise that provide the captured image when fulfilled.
fromLibrary()
Section titled “fromLibrary()”Presents the photo library for picking an image.
static fromLibrary(): Promise<Image>Use this for picking an image from the photo library.
Return value
Section titled “Return value”Promise<Image>
Promise that provide the selected image when fulfilled.
latestPhoto()
Section titled “latestPhoto()”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.
Return value
Section titled “Return value”Promise<Image>
Promise that provides the photo when fulfilled.
latestPhotos(count)
Section titled “latestPhotos(count)”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.
Parameters
Section titled “Parameters”count number
Number of photos to fetch.
Return value
Section titled “Return value”Promise<[Image]>
Promise that provides the photos when fulfilled.
latestScreenshot()
Section titled “latestScreenshot()”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.
Return value
Section titled “Return value”Promise<Image>
Promise that provides the screenshot when fulfilled.
latestScreenshots(count)
Section titled “latestScreenshots(count)”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.
Parameters
Section titled “Parameters”count number
Number of screenshots to fetch.
Return value
Section titled “Return value”Promise<[Image]>
Promise that provides the screenshots when fulfilled.
removeLatestPhoto()
Section titled “removeLatestPhoto()”Removes latest photo.
static removeLatestPhoto()Before removing the photo, an alert is shown prompting you to confirm the removal.
removeLatestPhotos(count)
Section titled “removeLatestPhotos(count)”Removes latest photos.
static removeLatestPhotos(count: number)Before removing the photos, an alert is shown prompting you to confirm the removal.
Parameters
Section titled “Parameters”count number
Number of photos to remove.
removeLatestScreenshot()
Section titled “removeLatestScreenshot()”Removes latest screenshot.
static removeLatestScreenshot()Before removing the screenshot, an alert is shown prompting you to confirm the removal.
removeLatestScreenshots(count)
Section titled “removeLatestScreenshots(count)”Removes latest screenshots.
static removeLatestScreenshots(count: number)Before removing the screenshots, an alert is shown prompting you to confirm the removal.
Parameters
Section titled “Parameters”count number
Number of screenshots to remove.
save(image)
Section titled “save(image)”Save an image.
static save(image: Image)Saves the image to the photo library.
Parameters
Section titled “Parameters”image Image
The image to save.