April 2014 update: we have moved the project and packaged it with a sleek manual on our new website, along with a sleek manual and demo video. Check it out: http://easynativeextensions.com/product/diadraw-e-mail-ane/

Do you remember the olden days, when Adobe AIR and Apple’s iOS didn’t seem to play nicely, when it came to orientation?

Right. Well, that was only a few months and a couple of AIR releases ago, but since then Adobe have fixed their stuff and so we have updated our e-mail extension to reflect that.

Many of you contributed with feedback and ideas to our previous post, Native extensions for mobile AIR apps – getting round the orientation issue - thanks go to all of you! Special thanks to Nicolas Jauffret for alerting us about orientation issues with the new Adobe AIR SDKs and to Dave for letting us know that messages were not received by ActionScript!

Where’s the ANE?

April 2014 update: we have moved the project and packaged it with a sleek manual on our new website, along with a sleek manual and demo video. Check it out: http://easynativeextensions.com/product/diadraw-e-mail-ane/

What’s new?

1. Code has been updated to work with Adobe AIR 3.4 and iOS 6.0
  • Built using Adobe Flash Builder 4.6 with Adobe AIR 3.4 and XCode 4.5 with iOS SDK 6.0
  • Tested on an iPhone with iOS 6
2. No more orientation mumbo-jumbo

For those of you who will build the extension from scratch, the workaround is still there, but disabled. Uncomment the following line in MailComposerDelegate.m, if you use the extension with Adobe AIR 3.2 or older:

//#import "UIViewController+Orientation.h"

For details on how and why this works, have a look at our initial post:  Native extensions for mobile AIR apps – getting round the orientation issue.

3. Optional HTML in the body

The extension initially was set not to use HTML at all – thanks to Chuck for his feedback on that!

We added an optional Boolean parameter to the sendMail function, so you can set from your ActionScript whether the e-mail body will have HTML turned on or off. The parameter is optional and is TRUE by default, so even if you don’t include it explicitly, your old code should still work.

For example use of sendMail have a look at FlexApp/src/views/TestEmailAppHomeView.mxml:

m_mailExtension.sendMail
( subject,
  body,
  toRecepients,
  ccRecepients,
  bccRecepients,
  [attachmentStr],
  useHtml );
4. Bug fix: not all messages from the native side were received by the ActionScript side

… and the moral of the story was: mind your variables’ lifelines! :) Looks like native code wasn’t holding on to the ExtensionContext instance for long enough, so any asynchronous messages that were sent after the mail composer was dismissed were lost.

Thanks to Dave for alerting us to the problem!

Let us know what you think

The community has been wonderful about providing feedback and alerting us to problems. Keep ‘em coming! You can post comments here or get in touch with us directly via office@diadraw.com.

Opt In Image
Making your own extension?

Fill in your details below and get a free sample of the Easy Native Extensions eBook.

  • step-by-step guide to making your iOS extension in under an hour
  • tutorials
  • infographics
  • example code

About the Author

Radoslava is co-founder of DiaDraw. Prefers to communicate with images. Verbal communication always caused trouble with her parents. Started speaking Basic early on, followed by four years of Delphi, six years of C++, four years of ActionScript, lately converses in Objective-C. Her mum and dad hope she'll start speaking human at some point.