jamian
jamian

Reputation: 1652

cordova camera plugin asks permission every time

I'm using

cordova plugin add cordova-plugin-camera 

to access the gallery of the user. however the plugin makes the app ask for permission everytime. while testing it on my phone, even though i granted permission once the plugin keeps asking for permission everytime i call the

navigator.camera.getPicture(
  cameraSuccess,
  cameraError,
    {
      destinationType: Camera.DestinationType.FILE_URI,
      sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    }
);

also if i deny the permission the second time the APP crashes.

Upvotes: 3

Views: 1374

Answers (1)

davidbwire
davidbwire

Reputation: 96

The feature to persist granted permission was missing on earlier versions of the plugin. This is fixed with the most recent release (at the time of writing it's rel/2.4.0).

1) Uninstall the the current plugin and then...

cordova plugin remove cordova-plugin-camera

2) ... install the latest version of it.

cordova plugin add cordova-plugin-camera rel/2.4.0

Upvotes: 1

Related Questions