I am trying to export an application made using Cordova to a Windows 8.1 desktop / tablet and Windows Phone 8.1. My application successfully runs on Android, iOS.
cordova -v 4.1.2 cordova plugins list org.apache.cordova.file 1.3.1 "File"
But when I try to use Windows 8.1 or Windows Phone, my application fails. "Cordova.file" is undefined. I cannot access the cordova.file.dataDirectory file to store my data or any cordova.file file. *. Alias.
I do not see "Quirks" for Windows on https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md , am I missing something?
UPDATE
I found a solution for Windows Phone, I set 'cordova.file.dataDirectory' to '///' (org.apache.cordova.device is required for the device):
if(cordova.file === undefined){ // WP8 if(device.platform === "Win32NT"){ cordova.file = { dataDirectory: '///' } }else // Windows 8 if(device.platform === "windows"){ cordova.file = { dataDirectory: '?????' } } }
For Windows 8, I'm still looking for a solution.
source share