aZtraL-EnForceR
aZtraL-EnForceR

Reputation: 1788

Phonegap camera API save picture taken to camera roll

Is it possible using the Cordova camera API to take a picture and then store it locally in the camera roll on iOS and Android? I know its possible, but does it involve native code somehow or can it be done in pure HTML? The documentation doesn't say anything about this.

Upvotes: 2

Views: 7941

Answers (2)

Amstre Sriboonevorakul
Amstre Sriboonevorakul

Reputation: 151

Simply add saveToPhotoAlbum: true in cameraOptions param.

For example

navigator.camera.getPicture(onPhotoDataSuccess, onFail,
{
  quality: 50,
  destinationType: destinationType.FILE_URI,
  saveToPhotoAlbum: true
});

saveToPhotoAlbum is set to false by default.

Reference

Upvotes: 15

wmfairuz
wmfairuz

Reputation: 1043

Do you mean the device's gallery?

If so, just use FILE_URI for Camera.DestinationType option.

Reference: http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#cameraOptions

Upvotes: 1

Related Questions