fragatak edited a comment on issue #239:
URL: 
https://github.com/apache/cordova-plugin-file/issues/239#issuecomment-681093460


   This is the code that is used with the app first starts up to check 
permission.
   
   `
   function androidPermissions()
   {
       let permissions = cordova.plugins.permissions;
       let list = [
           permissions.WRITE_EXTERNAL_STORAGE,
           permissions.READ_EXTERNAL_STORAGE
       ];
   
       function error() {
           console.warn('External Read or Write permission is not turned on');
       }
   
       permissions.checkPermission(list, function (status) {
           if (!status.hasPermission) {
               permissions.requestPermissions(
               list,
               function(status) {
                   if (!status.hasPermission) error();
               },
               error
               );
           }
       }, null);
   }
   
   document.addEventListener("deviceready", androidPermissions, null);
   
   `


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to