/**
 * @title Open - cordova.plugins.bridge.open
 * @overview Open documents with compatible apps.
 * @copyright © 2014 cordova-bridge
 * @license GPLv2
 * @author Carlos Antonio
*/

var exec = require('cordova/exec');

/**
 * open
 *
 * @param {String} args File URI
 * @param {Function} success Success callback
 * @param {Function} error Failure callback
 */
exports.open = function(uri, success, error) {
  if (!uri || arguments.length === 0) return false;

  function onSuccess(path) {
    if (typeof success === 'function') success(path);
    return path;
  }

  function onError(code) {
    code = code || 0;
    if (typeof error === 'function') error(code);
    return code;
  }

  uri = encodeURI(uri);

  function downloadAndOpen(url) {
    var ft = new FileTransfer(),
        tmp = cordova.file.tempDirectory,
        ext = cordova.file.externalCacheDirectory,
        dir = (tmp) ?  tmp : ext,
        name = url.substring(url.lastIndexOf('/') + 1),
        path = dir + name;

    ft.download(url, path,
        function done(entry) {
          var file = entry.toURL();
          exec(onSuccess, onError, 'Open', 'open', [file]);
        },
        onError,
        false
    );
  }

  if (uri.match('http')) {
    downloadAndOpen(uri);
  } else {
    exec(onSuccess, onError, 'Open', 'open', [uri]);
  }
};

@@ -781,19 +781,19 @@
         
-tmp
+ios
  = cordo
@@ -804,12 +804,13 @@
 ile.
-temp
+cache
 Dire
@@ -886,19 +886,19 @@
  = (
-tmp
+ios
 ) ?  
-tmp
+ios
  : e

Use iOS cache instead of tmp