7

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?

Darrell Brogdon
  • 6,843
  • 9
  • 47
  • 62

2 Answers2

15

Think I found it:

soureType: Camera.PictureSourceType.PHOTOLIBRARY,

should be:

sourceType: Camera.PictureSourceType.PHOTOLIBRARY,

sourceType has a typo in it. Maybe thats it?

Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31
-2

Below code is for access gallery photos:

 Camera.sourceType = Camera.PictureSourceType.PHOTOLIBRARY 

 or

 Camera.PictureSourceType.SAVEDPHOTOALBUM, 

then a photo chooser dialog is shown, from which a photo from the album can be selected.

Darshan
  • 2,272
  • 3
  • 31
  • 43