I've run into a strange bug with MFMessageComposeViewController in iOS8, that is only reproducible within my own app. It's affecting the app right now in the App Store, built with the iOS7 SDK running on iOS8, as well with the iOS8 SDK in my own test devices (iPhone and iPad)
The issue is that when I bring up the MFMessageComposeViewController, it shows me the controller without a text field or a Send button anymore. I haven't changed my code between iOS7 and iOS8, so not sure why this is happening. The code itself is very simple:
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
[picker setRecipients: @[@"5551112222"]];
[picker setBody: @"Test"];
[self presentViewController:picker animated:YES completion: ^{
NSLog(@"MFMessageComposeViewController completion handler");
}];
This is what it looks like:
Any ideas for what I can try for a work-around? I've tried setting the textField and recipients in the completion handler; tried calling becomeFirstResponder on the top-most view controller; no luck. Again, this was/is working perfectly fine in iOS7.
EDIT:
So I found Apple's own sample code for MFMessageComposeViewController
from this link: https://developer.apple.com/library/ios/samplecode/MessageComposer/Listings/MessageComposerViewController_m.html
When I build and run this app, the MFMessageComposeViewController
shows up perfectly, and pre-filling the phone number and text fields works as well. But when I copy their files into my app, make their storyboard my main storyboard, press the "Compose SMS" button and I see the same exact problem!
What is going on here? Very confused. Could it be some configuration in my own app that is preventing the message composer from displaying correctly?