code: function downloadAndOpen(url, success, error, progress, trustAllCertificates) {
    var ft = new FileTransfer();
    var ios = cordova.file.cacheDirectory;
    var ext = cordova.file.externalCacheDirectory;
    var dir = (ext) ? ext : ios;
    var name = url.substring(url.lastIndexOf('/') + 1);
    var path = dir + name;
  
    if (typeof trustAllCertificates !== 'boolean') {
      // Defaults to false
      trustAllCertificates = false;
    }
  
    if (progress && typeof progress === 'function') {
      ft.onprogress = progress;
    }
  
    ft.download(url, path,
        function done(entry) {
          var file = entry.toURL();
          exec(onSuccess.bind(this, file, success),
               onError.bind(this, error), 'Open', 'open', [file]);
        },
        onError.bind(this, error),
        trustAllCertificates
    );
  }
docs: downloadAndOpen
  
  @param {String} url File URI
  @param {Function} success Success callback
  @param {Function} error Failure callback
  @param {Function} progress Callback for download progress reporting
  @param {Boolean} trustAllCertificates Trusts any certificate when the connection is done over HTTPS.
  @returns {void}