sgrebnov / cordova-plugin-background-download

Apache License 2.0
73 stars 77 forks source link

why my app for ios download complete the size is 0 byte #38

Open ghost opened 7 years ago

ghost commented 7 years ago

const fileTransfer = new BackgroundTransfer.BackgroundDownloader(); console.log(item.fileUrl+"===="+targetPath) File.createFile(targetPath,filename,false).then(entry=>{

      let download = fileTransfer.createDownload(item.fileUrl, entry);
      download.startAsync().then((entry) => {
        self.addToDownloaded(item);
        resolve(item);
        item['filePath'] = targetPath;
        // VideoUtils.playVideo(targetPath);
        // self.events.publish('download:done');
      }, (error) => {
        reject(error);
        // self.events.publish('download:error');
      }, (progressEvent) => {
        this.ngZone.run(() => {
          if (!!progressEvent) {
            onProgress(progressEvent);
          }
        });
      });