You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/12/12 01:29:33 UTC

ios commit: Updated Plugin Upgrade Guide to 2.3.0 (also 2.2.0)

Updated Branches:
  refs/heads/master 145d4578c -> 6c67a0a1a


Updated Plugin Upgrade Guide to 2.3.0 (also 2.2.0)


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

Branch: refs/heads/master
Commit: 6c67a0a1aa47645cffe00414cc9fe086433fb7bc
Parents: 145d457
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue Dec 11 16:29:21 2012 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Dec 11 16:29:21 2012 -0800

----------------------------------------------------------------------
 guides/Cordova Plugin Upgrade Guide.md |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/6c67a0a1/guides/Cordova Plugin Upgrade Guide.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Plugin Upgrade Guide.md b/guides/Cordova Plugin Upgrade Guide.md
index 3b9e944..a173070 100644
--- a/guides/Cordova Plugin Upgrade Guide.md	
+++ b/guides/Cordova Plugin Upgrade Guide.md	
@@ -22,6 +22,29 @@
 
 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 Upgrade Guide" document.
 
+## Upgrading older Cordova plugins to 2.3.0 ##
+
+1. **Install** Cordova 2.3.0
+2. Follow the **"Upgrading older Cordova plugins to 2.2.0"** section, if necessary
+3. Network connections by plugins are **no longer checked** by the whitelist. To use the whitelist for your plugin network connections, you have to set the "User-Agent" header of your connection to the user-agent of the viewController.
+
+        CDVViewController* vc = ((CDVViewController*)self.viewController);
+        NSString* userAgent = vc.userAgent;
+        // then set the User-Agent header of your network connection...
+        
+4. After that, you can **query the whitelist** to see if your URL will pass it:
+
+        CDVViewController* vc = ((CDVViewController*)self.viewController);
+        BOOL passesWhitelist = [vc URLisAllowed:[NSURL URLWithString:@"http://apache.org"]];
+
+## Upgrading older Cordova plugins to 2.2.0 ##
+
+1. **Install** Cordova 2.2.0
+2. Follow the **"Upgrading older Cordova plugins to 2.1.0"** section, if necessary
+3. You don't need to create and write the javascript anymore. At the end of your plugin method, just send the CDVPluginResult and callbackId to your commandDelegate:
+
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+
 ## Upgrading older Cordova plugins to 2.1.0 ##
 
 1. **Install** Cordova 2.1.0