Last Photo Taken

PhoneGap plugin to retrieve the last photo taken.
Jonathan Aquino0.0.20
platforms: ios
$ cordova plugin add com.ning.last-photo-taken


This plugin provides an API for taking pictures and for choosing images from the system's image library. It only works in iOS - if someone can submit a pull request to make it work in Android, that would be appreciated.

cordova plugin add com.ning.last-photo-taken


Retrieves the last photo taken by the user. The onSuccess callback is passed the URI for the image file. The onError callback is passed an error message. Works on iOS only.

navigator.LastPhotoTaken.getLastPhoto(onSuccess, onError);


The getLastPhoto function retrieves the last photo taken by the user, at its original size, and at its current orientation. The user may be prompted to give access to photos on the device. The URI returned is for a temporary jpeg file created in NSTemporaryDirectory.

Supported Platforms

  • iOS


If the device is running iOS, retrieve the URI for the last photo taken:

// May need to install the device plugin:
if (device.platform === 'iOS') {
  navigator.LastPhotoTaken.getLastPhoto(function (imageUri) {
    alert('imageUri: ' + imageUri);
  }, function (errorMessage) {