0
votes

I'm using the official cordova camera plugin in order to load an image to an tag from a photo library, so I made a button to call the navigator.camera.GetPicture() method. After the click event on the bottom of the screen I get a "Get Picture" modal/toast with two options where can I browse my pictures: Gallery or Photos. If I choose the gallery everything works fine and I can repeat this multiple times. But If I choose the photos option I almost always get an error: "refused to load the image because it violates the following..." So any idea? I tried to modify the meta tags, but no result. Or how can I force the browsing only the gallery?

Thanks,

1

1 Answers

0
votes

You can configure the options.

var cameraRollOptions = {
  'sourceType': window.navigator.camera.PictureSourceType.PHOTOLIBRARY,
};
window.navigator.camera.getPicture(successHandler, errorHandler, cameraRollOptions);

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html#cameraoptions-errata-