rolinger commented on issue #646:
URL: 
https://github.com/apache/cordova-plugin-file/issues/646#issuecomment-2638233484

   @breautek - as always, thanks for your thorough explanations.  Well, turns 
out this particular user has a `Moto G Pure`.  A quick google search for `does 
moto g pure phone have emulated external storage?` returns:
   
   `No, the Moto G Pure does not have emulated external storage, but it does 
support a microSD card for additional storage. You can use the microSD card as 
portable storage or internal storage. `
   
   That phone comes with 32G internal memory....so I am guessing the user 
doesn't have a microSD or removed it.  I think maybe he removed it because my 
app launched without issue like 18+ times, then the last few times it started 
breaking.  I think I am just going to move everything to `dataDirectory`.  Or I 
need some code to check for externalDataDirectory, then if doesn't exist, use 
the `dataDirectory` - this is probably preferred so all existing users can 
still get to their existing files and dataDirectory will only ever be used for 
phones that don't have external, emulated or not.
   
   To do this I think it would be, any comments would be appreciated:
        var appDataDir ;
         window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, 
            function (directoryEntry) {  // SUCCESS external exists, then 
create 'downloads' here
              appDataDir = cordova.file.externalDataDirectory ;
              directoryEntry.getDirectory("downloads", { create: true, 
exclusive: false}, 
                function(success) {
                },
                function(err) {
                }
              ) ;
         },
         function (err) {  // FAIL, external does not exist
            window.resolveLocalFileSystemURL(cordova.file.dataDirectory, 
               function(directoryEntry) {  // SUCCESS internal exists, create 
downloads here
                 appDataDir = cordova.file.dataDirectory ;
                 directoryEntry.getDirectory("downloads", { create: true, 
exclusive: false}, 
                   function(success) {
                   },
                   function(err) {
                   }
                 ) ;
            }) ;
         }) ;


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

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to