How can I get the local file system path to the shared folder for meteor phonegap application with javascript

In the meteor phonegap application, all files in / public are uploaded to the device’s local file system.

On disk, the path to the shared folder looks something like this:

/Users/abc/Library/Developer/CoreSimulator/Devices/065B5AF8-FE25-4813-8E7D-AA88270DAD88/data/Containers/Data/Application/F73D96BC-EA19-4584-BE52-1D3B3AB8197C/Library/NoCloud/meteor/415e7371b3dc46d1fe41d04a4c4b6cb4ffc40811/

I can easily get the bit before '/ meteor /' by calling the cordova.file.dataDirectory file, but how can I get this id version after '/ meteor /'? I assume this is some kind of hot code that gives out the version number?

I know that I can use the api file to read the directory, but is there a more elegant way from the meteor itself that can provide the same information?

+4
source share
2 answers

, , , sass , :

@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionic-sass/ionic';

.

./public 

.

0

iOS, Android.

, bell.wav, (/public/bell.wav).

getLocalPath = function(file) {
    return cordova.file.applicationDirectory.replace('file://', '') + 'www/application/' + file;
};



getLocalPath('bell.wav')
0

Source: https://habr.com/ru/post/1568246/


All Articles