Official Content

The Photo Library API enables you to interact with the photo gallery of the device.

As the Camera external object enables an app to interact with the photo camera of the device, this API allows the application to save or get an image or a video from the native photo gallery. This article focuses on what this API does and gives an example of how to use it in a Native Mobile application.

PhotoLibraryexternalobject-Location_png PhotoLibrary external object - Structure

Properties

It does not have any.

Methods

Save method

The Save method enables the application to store an image on the device's native photo gallery application.

Return value None
Parameters Image:Image

Save Video method

The SaveVideo method enables the application to store a video on the device's native photo gallery application.

Return value None
Parameters Video:Video

ChooseImage method

This method invokes the native photo gallery app and lets the user choose one image to be used in the application.
It returns a variable based on Image data type.

Return value Image
Parameters None

Note: This method does not work using the emulator. It only works on Apple devices.

ChooseVideo method

This method invokes the native photo gallery app and lets the user choose one video to be used in the application.
It returns a variable based on Video data type.

Return value Video
Parameters None

ChooseImages method

This method invokes the native photo gallery app and lets the user choose several images to be used in the application.
It returns a collection of items based on Image data type.

Return value ImagesCollection
Parameters None

Note: This method does not work using the emulator. It only works on Apple devices.

Events

It does not have any.

Structured Data Types

ImagesCollection

A collection of Image data type.

Scope

Generators: Apple, Android, Angular (only for ChooseImage and ChooseImages methods).

Availability

This external object is available as of GeneXus X Evolution 3.

Notes

  • As of GeneXus 17, the PhotoLibrary external object uses the new PHPicker when running in iOS 14 and above, which improves user privacy regarding the application access to the photo library and replaces the now deprecated UIImagePickerViewController.

See also





Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant