From a59cad68e25ab26b8d91377dbdb3f6d2d0ae4c22 Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Fri, 17 Sep 2010 16:53:52 -0500 Subject: [PATCH] Device returns string, but for some reason emulator returns object - so convert to string. --- framework/assets/js/phonegap.js.base | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/assets/js/phonegap.js.base b/framework/assets/js/phonegap.js.base index af0fb556..88a790d9 100755 --- a/framework/assets/js/phonegap.js.base +++ b/framework/assets/js/phonegap.js.base @@ -286,10 +286,12 @@ PhoneGap.execAsync = function(success, fail, clazz, action, args) { if (success || fail) { PhoneGap.callbacks[callbackId] = {success:success, fail:fail}; } - var r = PluginManager.exec(clazz, action, callbackId, this.stringify(args), true); + + // Note: Device returns string, but for some reason emulator returs object - so convert to string. + var r = ""+PluginManager.exec(clazz, action, callbackId, this.stringify(args), true); // If a result was returned - if ((typeof r == "string") && (r.length > 0)) { + if (r.length > 0) { eval("var v="+r+";"); // If status is OK, then return value back to caller