From b850d225f406bd06744c5dfc1cc14722dd23ccb4 Mon Sep 17 00:00:00 2001 From: macdonst Date: Wed, 30 Mar 2011 03:39:27 +0800 Subject: [PATCH] Support old way of adding service in PhoneGap 0.9.5 PhoneGap 0.9.4 replaced PluginManager.addService() with navigator.app.addService(). This is problematic with the older plugin as they are not being maintained. I'm adding in a PluginManger JavaScript class which will implement the addService method and call navigator.app.addService() method under the hood. This way we won't break old code. --- framework/assets/js/phonegap.js.base | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/assets/js/phonegap.js.base b/framework/assets/js/phonegap.js.base index 9d39aa94..c9181b5e 100755 --- a/framework/assets/js/phonegap.js.base +++ b/framework/assets/js/phonegap.js.base @@ -893,3 +893,16 @@ PhoneGap.includeJavascript = function(jsfile, successCallback) { el.src = jsfile; id.appendChild(el); }; + + +/** + * This class is provided to bridge the gap between the way plugins were setup in 0.9.3 and 0.9.4. + * Users should be calling navigator.add.addService() instead of PluginManager.addService(). + * @class + * @deprecated + */ +var PluginManager = { + addService: function(serviceType, className) { + navigator.app.addService(serviceType, className); + } +};