My app is not on typescript, just plain javascript. Do I do it right? I can not download.
I try to download the url that is being sent to this function. But dm.downloadFile does not work. Console log "inside downfile" is not getting called.
var DownloadManager = require('nativescript-downloadmanager');
`
function DownloadFile(url) {
let dm = new DownloadManager();
dm.downloadFile(url, function(result,uri) {
// result is a boolean, if the download was successful, it will return true
console.log("********************************* inside downfile ****************");
console.log(result);
// Uri in file:// format of the downloaded file.
console.log(uri);
// unregisterBroadcast is used to unregister the broadcast (For example if you just want to
// download a single file).
dm.unregisterBroadcast();
})
}`
My app is not on typescript, just plain javascript. Do I do it right? I can not download.
I try to download the url that is being sent to this function. But
dm.downloadFile
does not work. Console log "inside downfile" is not getting called.