filelogger
filelogger copied to clipboard
proposal: add option to change cordova.file.dataDirectory to cordova.file.externalDataDirectory
Hi, upon testing your plugin I found that if a internal webserver is used*, the log file is stored under cdvfile://localhost/files/
I found in your sourcecode, if I changed all appearances of cordova.file.dataDirectory to cordova.file.externalDataDirectory the file gets created and I can find it under /Android/data/
*see these plugins: cocoon-cordova-labs-local-webserver, cocoon-cordova-labs-wkwebview-engine-localhost, cocoon-cordova-plugin-wkwebview-engine
Using Ionic 1.3.3 & cordova 6.5.0, my device is a Samsung Galaxy J3 2016
+1
We can't change everything to cordova.file.externalDataDirectory as that breaks iOS. cordova.file.dataDirectory is correct and works on both Android and iOS.
When you do $filelogger.checkFile() it returns a name. All you need to do is:
var myFileWithPath = cordova.file.dataDirectory + result.name // result is the return object from checkFile
And you'll get the full path with file. Verified with wkwebview and iOS and Android. Sample code.