You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/06/11 02:51:28 UTC

[14/36] ios commit: [CB-3528] Update Plugin Upgrade Guide for iOS

[CB-3528] Update Plugin Upgrade Guide for iOS


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/e18d69ad
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/e18d69ad
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/e18d69ad

Branch: refs/heads/3.0.0
Commit: e18d69ad43a73d33806f00346b6264ede7013d39
Parents: ec682c5
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue May 28 17:07:18 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue May 28 17:07:18 2013 -0700

----------------------------------------------------------------------
 guides/Cordova Plugin Upgrade Guide.md | 65 +++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/e18d69ad/guides/Cordova Plugin Upgrade Guide.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Plugin Upgrade Guide.md b/guides/Cordova Plugin Upgrade Guide.md
index 7a03bc4..8fc3776 100644
--- a/guides/Cordova Plugin Upgrade Guide.md	
+++ b/guides/Cordova Plugin Upgrade Guide.md	
@@ -22,6 +22,71 @@
 
 This document is for developers who need to upgrade their Cordova  plugins to a newer Cordova version. Starting with Cordova 1.5.0, some classes have been renamed, which will require the plugin to be upgraded. Make sure your project itself has been upgraded using the [Cordova iOS Upgrading Guide](http://cordova.apache.org/docs/en/edge/guide_upgrading_ios_index.md.html#Upgrading%20Cordova%20iOS) document.
 
+## Upgrading older Cordova plugins to 2.8.0 ##
+
+1. **Install** Cordova 2.8.0
+2. Follow the **"Upgrading older Cordova plugins to 2.7.0"** section, if necessary
+3. The &lt;plugin&gt; tag in **config.xml** has been deprecated and support will be removed in 3.0.0. To upgrade to the &lt;feature&gt; tag, see this example:
+
+        <plugins>
+            <plugin name="LocalStorage" value="CDVLocalStorage" />
+            <!-- other plugins -->
+        </plugins>
+        
+        <!-- change to: (note that a <feature> tag is on the same level as <plugins> -->
+        <feature name="LocalStorage">
+        <param name="ios-package" value="CDVLocalStorage" />
+        </feature>
+        
+
+## Upgrading older Cordova plugins to 2.7.0 ##
+
+1. **Install** Cordova 2.7.0
+2. Follow the **"Upgrading older Cordova plugins to 2.6.0"** section, if necessary
+3. The old cordova.exec signature has been deprecated since 2.1, and removed in 2.7.0. See upgrade steps below.
+
+When you use a method signature in JavaScript like this:
+
+        cordova.exec('MyService.myMethod', myArg1, myArg2, myArg3);
+
+
+The console log will ask you to upgrade it like this:
+
+        The old format of this exec call has been removed (deprecated since 2.1). 
+        Change to: cordova.exec(null, null, "MyService", "myMethod", [ myArg1, myArg2, myArg3 ]);
+
+
+But, if your corresponding Objective-C method uses the old signature like so:
+
+        - (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+
+
+Update it to this new signature:
+
+        - (void) myMethod:(CDVInvokedUrlCommand*)command;
+
+Also update any references to "arguments" in the method body with "command.arguments".
+
+So if your method looked like this:
+
+		- (void) myMethod:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+		{
+			NSString* myArgs1 = [arguments objectAtIndex:0];
+			NSString* myArgs2 = [arguments objectAtIndex:1];
+			NSString* myArgs3 = [arguments objectAtIndex:2];
+		}
+
+Change it to this:
+
+		- (void) myMethod:(CDVInvokedUrlCommand*)command
+		{
+			NSString* myArgs1 = [command.arguments objectAtIndex:0];
+			NSString* myArgs2 = [command.arguments objectAtIndex:1];
+			NSString* myArgs3 = [command.arguments objectAtIndex:2];
+		}
+
+This is the easiest upgrade path. If you want to further use the more powerful callback mechanisms provided, see the [Plugin Development Guide](http://docs.phonegap.com/en/2.7.0/guide_plugin-development_ios_index.md.html#Developing%20a%20Plugin%20on%20iOS) to upgrade your plugin.
+
 ## Upgrading older Cordova plugins to 2.6.0 ##
 
 1. **Install** Cordova 2.6.0