You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/03/18 19:00:24 UTC

[GitHub] [cordova-plugin-media-capture] joaoduartemariucio commented on issue #130: Do you have to request permission manually on Android?

joaoduartemariucio commented on issue #130: Do you have to request permission manually on Android?
URL: https://github.com/apache/cordova-plugin-media-capture/issues/130#issuecomment-474056748
 
 
   I have faced the same problem while using the plugin but found out the reason. From version 8.0 of Android onwards there are two permissions to be requested WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE before only the READ_EXTERNAL_STORAGE permission was required. So the plugin is not updated with the new version of Android I solved manually in the Java Capture class in the captureImage function inserted the following code:
   
   
   `boolean needWritePermission = PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
           if(!needWritePermission){
               PermissionHelper.requestPermission(this,req.requestCode, Manifest.permission.WRITE_EXTERNAL_STORAGE);
           }`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org