ioscordovacordova-pluginscordova-plugin-file

All cordova.file directories are null on iOS


I'm using the cordova-plugin-file. Everything works fine on Android, but on iOS the path is always null for all directories. Alerting cordova.file gives me:

{ 
"applicationDirectory":null,
"applicationStorageDirectory":null,
"dataDirectory":null,
"cacheDirectory":null,
"externalApplicationStorageDirectory":null,
"externalDataDirectory":null,
"externalCacheDirectory":null,
"externalRootDirectory":null,
"tempDirectory":null,
"syncedDataDirectory":null,
"documentsDirectory":null,
"sharedDirectory":null
}

Things I've tried: this and this, but nothing seem to work for me.

List and versions of plugins installed:

cordova-plugin-android-permissions 1.0.0 "Permissions"

cordova-plugin-compat 1.1.0 "Compat"

cordova-plugin-device 1.1.6 "Device"

cordova-plugin-dialogs 1.3.3 "Notification"

cordova-plugin-file 4.3.3 "File"

cordova-plugin-file-opener2 2.0.19 "File Opener2"

cordova-plugin-file-transfer 1.6.3 "File Transfer"

cordova-plugin-globalization 1.0.7 "Globalization"

cordova-plugin-mfp 8.0.2017090705 "IBM MobileFirst Platform Foundation"

cordova-plugin-okhttp 2.0.0 "OkHttp"

cordova-plugin-whitelist 1.3.2 "Whitelist"

I'm stuck and don't know what else to try.


Solution

  • Found out that the plugin didn't work because I changed Content-Security-Policy. Solved it by changing it back to default and paths are now no longer null.