rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

BW::Mail.compose crashes app #482

Closed andersennl closed 4 years ago

andersennl commented 8 years ago

Hi, I've got a strange error. It's strange because I can't tell since when it appeared and why it appears, as nothing in my code, touching this, has changed. I've tried the demo code from the docs as well but the simulator keeps crashing. Additionally, I get a message from OSX saying MailCompositionService quit unexpectedly. Here is the error log from the terminal:

(main)> 2015-12-16 11:17:30.652 testapp 2[20958:29185122] viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
2015-12-16 11:17:30.673 testapp 2[20958:29185122] Trying to dismiss the presentation controller while transitioning already. (<_UIFullscreenPresentationController: 0x110d0e390>)
2015-12-16 11:17:30.698 testapp 2[20958:29185122] transitionViewForCurrentTransition is not set, presentation controller was dismissed during the presentation? (<_UIFullscreenPresentationController: 0x110d0e390>)

Just to make sure, this is the code from the docs that I'm using:

BW::Mail.compose(
  delegate: self, # optional, defaults to rootViewController
  to: [ "tom@example.com" ],
  cc: [ "itchy@example.com", "scratchy@example.com" ],
  bcc: [ "jerry@example.com" ],
  html: false,
  subject: "My Subject",
  message: "This is my message. It isn't very long.",
  animated: false
) do |result, error|
  result.sent?      # => boolean
  result.canceled?  # => boolean
  result.saved?     # => boolean
  result.failed?    # => boolean
  error             # => NSError
end

What could this be? Thanks!

hboon commented 8 years ago

Not sure if this is related: iOS occasionally has problems with the email share sheet on the simulator. Try running this on an iOS device and see if it works.

andersennl commented 8 years ago

Interesting, I never had any problems opening the compose window in the simulator - and now it crashes every time. I'll test that, thanks for the hint.

danjohnson3141 commented 8 years ago

I'm having the same issue. I'll try it on an actual device and hopefully that'll solve it. Makes testing a little troublesome though.