cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject docs commit: CB-2540: Document iOS MultiPart PluginResult
Date Wed, 27 Feb 2013 14:55:25 GMT
Updated Branches:
  refs/heads/master 888deeaac -> 9927fcdf9

CB-2540: Document iOS MultiPart PluginResult


Branch: refs/heads/master
Commit: 9927fcdf9cdbdfb57233c7b94f3fa664613c5229
Parents: 888deea
Author: Michal Mocny <>
Authored: Wed Feb 27 09:54:34 2013 -0500
Committer: Michal Mocny <>
Committed: Wed Feb 27 09:54:34 2013 -0500

 docs/en/edge/guide/plugin-development/ios/ |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/docs/en/edge/guide/plugin-development/ios/ b/docs/en/edge/guide/plugin-development/ios/
index e5bfa88..d536b95 100644
--- a/docs/en/edge/guide/plugin-development/ios/
+++ b/docs/en/edge/guide/plugin-development/ios/
@@ -71,7 +71,20 @@ What gets dispatched to the plugin via JavaScript's `exec` function gets
 2. [CDVPluginResult.h](
 3. [CDVCommandDelegate.h](
+## iOS CDVPluginResult message types
+Using CDVPluginResult you can return a variety of result types back to your javascript callbacks,
using class methods that look like:
+    + (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAs...
+The types you can create are: `String`, `Int`, `Double`, `Bool`, `Array`, `Dictionary`, `ArrayBuffer`,
and `Multipart`.  Or, don't attach any result (just send a status).  Or, ruturn an Error.
 You can even not send any result at all.
+### Notes
+ * `messageAsArrayBuffer` expects `NSData*` and will convert to an `ArrayBuffer` for your
javascript callback (and `ArrayBuffers` sent to a plugin from javascript are converted to
+ * `messageAsMultipart` expects an `NSArray*` containing any of the other supported types,
and will send the whole array as the `arguments` to your javascript callback.
+   *  Quirk: this is not just syntactic sugar (though it is sweet).  This way, all of the
arguments are serialized/deserialized as necessary.  e.g. it is safe to return `NSData*` as
multipart, but not as `Array`/`Dictionary`.
 ## Plugin Signatures
 The **new signature** supported beginning in **Cordova 2.1.0** is:

View raw message