diff --git a/iOS/EmailComposer/EmailComposer.js b/iOS/EmailComposer/EmailComposer.js index 30ee4081..d3c28975 100755 --- a/iOS/EmailComposer/EmailComposer.js +++ b/iOS/EmailComposer/EmailComposer.js @@ -5,11 +5,11 @@ function EmailComposer() { } EmailComposer.ComposeResultType = { - Cancelled:0, - Saved:1, - Sent:2, - Failed:3, - NotSent:4 +Cancelled:0, +Saved:1, +Sent:2, +Failed:3, +NotSent:4 } @@ -30,14 +30,14 @@ EmailComposer.prototype.showEmailComposer = function(subject,body,toRecipients,c args.body = body; if(bIsHTML) args.bIsHTML = bIsHTML; - - Cordova.exec(null, null, "org.apache.cordova.emailComposer", "showEmailComposer", [args]); + + cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]); } // this will be forever known as the orch-func -jm EmailComposer.prototype.showEmailComposerWithCB = function(cbFunction,subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML) { - this.resultCallback = cbFunction; - this.showEmailComposer.apply(this,[subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML]); + this.resultCallback = cbFunction; + this.showEmailComposer.apply(this,[subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML]); } EmailComposer.prototype._didFinishWithResult = function(res) { @@ -46,10 +46,16 @@ EmailComposer.prototype._didFinishWithResult = function(res) { -Cordova.addConstructor(function() { - if(!window.plugins) - { - window.plugins = {}; - } - window.plugins.emailComposer = new EmailComposer(); -}); \ No newline at end of file +cordova.addConstructor(function() { + if(!window.plugins) + { + window.plugins = {}; + } + + // shim to work in 1.5 and 1.6 + if (!window.Cordova) { + window.Cordova = cordova; + }; + + window.plugins.emailComposer = new EmailComposer(); + }); \ No newline at end of file diff --git a/iOS/EmailComposer/index.html b/iOS/EmailComposer/index.html new file mode 100644 index 00000000..ea038aec --- /dev/null +++ b/iOS/EmailComposer/index.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + +

Hey, it's Cordova!

+

Don't know how to get started? Check out our Getting Started Guide +
+

    +
  1. Check your console log for any white-list rejection errors.
  2. +
  3. Add your allowed hosts in Cordova.plist/ExternalHosts (wildcards OK, don't enter the URL scheme)
  4. +
+ + diff --git a/iOS/EmailComposer/readme.md b/iOS/EmailComposer/readme.md index c66c3b79..3fcdddc6 100755 --- a/iOS/EmailComposer/readme.md +++ b/iOS/EmailComposer/readme.md @@ -6,10 +6,10 @@ Added Cordova 1.5 support March 2012 - @RandyMcMillan • Place the EmailComposer.js file in your app root, and include it from your html. -• Add to Cordova.plist Plugins: key org.apache.cordova.emailComposer value EmailComposer +• Add to Cordova.plist Plugins: key EmailComposer value EmailComposer • This is intended to also demonstrate how to pass arguments to native code using the options/map object. • Please review the js file to understand the interface you can call, and reply with any questions. - Cordova.exec(null, null, "org.apache.cordova.emailComposer", "showEmailComposer", [args]); + Cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]);