Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 345
Darrell Brogdon Avatar asked Jan 04 '14 03:01

Darrell Brogdon


1 Answers

Think I found it:

soureType: Camera.PictureSourceType.PHOTOLIBRARY,

should be:

sourceType: Camera.PictureSourceType.PHOTOLIBRARY,

sourceType has a typo in it. Maybe thats it?

like image 103
Dawson Loudon Avatar answered Oct 31 '22 15:10

Dawson Loudon