How to get a picture from the photo library with PhoneGap on iOS?

Darrell Brogdon picture Darrell Brogdon · Jan 4, 2014 · Viewed 9k times · Source

I'm using the following code to try to select a photo from the iOS photo library:

navigator.camera.getPicture(this.onCaptureSuccess, this.onCaptureFail, {
    allowEdit: true,
    correctOrientation: true,
    destinationType: Camera.DestinationType.FILE_URI,
    soureType: Camera.PictureSourceType.PHOTOLIBRARY,
    targetHeight: 315,
    targetWidth: 320
});

I'm using iOS 7 (7.0.4) on an iPhone 5s and PhoneGap 3.3.0. No matter what I do it always brings the camera up. What am I doing wrong?

Answer

Dawson Loudon picture Dawson Loudon · Jan 6, 2014

Think I found it:

soureType: Camera.PictureSourceType.PHOTOLIBRARY,

should be:

sourceType: Camera.PictureSourceType.PHOTOLIBRARY,

sourceType has a typo in it. Maybe thats it?