You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/26 20:02:20 UTC

[GitHub] [cordova-plugin-file] fragatak edited a comment on issue #239: Not seeing files that are stored on the Android device

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.
   
   [code]
   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);
   
   [/code]


----------------------------------------------------------------
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



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