EmailDialog does not open on iPad-1

You must Login before you can answer or comment on any questions.

Hello everyone, I have a very simple piece of code that is supposed to show up the email dialog when user clicks a button. It works fine in Simulator but not on the actual device, which is iPad-1 running iOS 5.1. I'm using Titanium SDK 2.1.3GA. Here's the code:

// currentImage is pulled from the imageView as Blob
      scaledImage = currentImage;
      var emailDlg = Ti.UI.createEmailDialog({
            barColor: '#999',
            subject: L('email_subject')
        });
        emailDlg.addAttachment(scaledImage);
        emailDlg.messageBody = L('email_body');
 
        emailDlg.open();
This snippet works just fine in the Simulator - the dialog pops up, I can see the attachment, everything is great. Once I drop it to the actual device, the dialog simply does not show up. Nothing in the logs, no exceptions, no error messages - not a blip. Any ideas?

— asked 8 months ago by Alex Stepanov
3 Comments
  • is there any mail account set on the iPad ? it works fine on mine, same settings.

    — commented 8 months ago by Alberto Marcone

  • Thanks Alberto, this was the reason :) When I added an email account, everything just started working. Which makes me wonder - is there any way I can detect that Mail is not configured (or get some error from TItanium) so I could at least tell users what to expect?

    — commented 8 months ago by Alex Stepanov

  • I'm not sure about that. There's only a FAILED property (not sure if applies) in the documented API.

    — commented 8 months ago by Alberto Marcone

1 Answer

The answer was: the emal dialog won't show up if you don't have a mail account set on your device.

Your Answer

Think you can help? Login to answer this question!