[
https://issues.apache.org/jira/browse/CB-11382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392797#comment-15392797
]
Ivan commented on CB-11382:
---------------------------
In file CameraLauncher.java in "if (action.equals("takePicture"))" statement I
add this code ...
if (ContextCompat.checkSelfPermission(cordova.getActivity(),
Manifest.permission.READ_EXTERNAL_STORAGE)
!=
PackageManager.PERMISSION_GRANTED) {
if
(ActivityCompat.shouldShowRequestPermissionRationale(cordova.getActivity(),
Manifest.permission.READ_EXTERNAL_STORAGE)) {
// Show an expanation to the
user *asynchronously* -- don't block
// this thread waiting for the
user's response! After the user
// sees the explanation, try
again to request the permission.
} else {
// No explanation needed, we
can request the permission.
ActivityCompat.requestPermissions(cordova.getActivity(),
new
String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
//
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE is an
// app-defined int constant.
The callback method gets the
// result of the request.
}
}
> Camera will not open
> --------------------
>
> Key: CB-11382
> URL: https://issues.apache.org/jira/browse/CB-11382
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Camera
> Reporter: Ivan
>
> I'm using Cordova Camera Plugin
> (https://www.npmjs.com/package/cordova-plugin-camera) and starting with this
> line
> navigator.camera.getPicture(onSuccessPhoto, onFailPhoto, { quality: 50,
> destinationType: Camera.DestinationType.FILE_URI });
> On android 6.0.1. camera will not open and I got error
> "permission denial: ... requires android.permission.read_external_storage or
> granturipermission()"
> On lower android version it works fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]