Closed markrickert closed 9 years ago
Mark, FWIW, I just tested my app (which uses BW::Mail
) and I was able to send and receive an email.
Yeah, I can too. But I've already had two reports of this in the wild. Not sure if this is a "bug", more than it's a "warning". I'll report back when I get this "manual" mail code into production.
Here's what I was using in the app:
def email_receipt
BW::Mail.compose(
delegate: self,
html: true,
subject: "My subject",
message: "My body",
) do |result, error|
# result.sent? # => boolean
# result.canceled? # => boolean
# result.saved? # => boolean
# result.failed? # => boolean
# error # => NSError
end
end
Wondering if it has anything to do with me not checking any of the result conditions? Dunno.
Huh. Stupid me. I just went and had a look at my code, and I'm not using BW::Mail
. And in fact, my code is almost identical to your workaround code that you posted above. I thought I was using BW::Mail
and now I can't recall why I went down that path. Ignore me!
No worries. Thanks for clarifying.
I had the same trouble. It looks because implementation of the method BubbleWrap::Mail.create_mail_controller is expecting the return value of MFMailComposeViewController.alloc.init always responds to mailComposeDelegate=. However if any mail account is not set up appropriately, MFMailComposeViewController.alloc.init returns nil.
Some more information here... I contacted apple and they say that it's a known bug. ALl my interactions with them are logged here:
@markrickert - Any update on this?
Yeah, well i got an update from apple a few days ago saying they couldn't reproduce it and that "woosh" sound isn't an indication that the email is actually SENT.
Hello Mark,
This is a follow-up regarding regarding Bug ID# 17930344.
We need more information to investigate this issue.
The whoosh sound does not indicate that the message was sent (anymore), it's just the sound that plays when the user is finished composing the message.
I am not able to reproduce this with the attached sample project, however. Can you give us some more details about your account setup? Does the message at least show up in the outbox?
Please provide your response or results by updating your bug report.
Please compress any bundled files (e.g. nested folders) prior to uploading.
IMPORTANT: This is an automated email. Please do not respond to this email. Bug reports requiring your attention will appear under ‘Attention’ section. Please review this bug report and provide the requested information via the Apple Bug Reporter.
Thank you for your assistance in helping us discover and isolate bugs within our products.
Best Regards,
Developer Bug Reporting Team Apple Worldwide Developer Relations
I can confirm that our app crashes due to undefined method `mailComposeDelegate=' for nil:NilClass (NoMethodError).
The method is sent in BubbleWrap mail/mail.rb to the object returned from MFMailComposeViewController.alloc.init
(line 37 of that file)
There are no email accounts configured on our test device which replicates the case reported above by
hnishide on Aug 18
I'll try replacing our BW code chunk with the workaround kindly provided by markrickert
If this cannot be fixed, perhaps Mail should be removed from BW as a partial answer to the 'bloat' issue? Or deprecated so people are aware there's an issue?
@myob that's actually a different problem that I've addressed in #436 . You have to check if the email is configured on the device and handle it gracefully if mail accounts don't exist.
Apple has moved on. Note that mail might not send in iOS 7. They indicated to me that this bug in ios 7 will not be fixed. All the more reason to make your apps iOS 8 only! :cry:
I'm getting reports of the BubbleWrap Mail functionality not working in production, and as usual, it's working for me from the app version from the app store. :cry:
Not sure if there's anything I can add to this other than:
This might be tricky to track down, so I've removed the
BW::Mail
code from my app and will be relying on the old method. For reference in RubyMotion, it's something like this:Hopefully this will work in the app update :/