MFMessageComposeViewController issue , Text non sent

Originator:szigetics
Number:rdar://16058726 Date Originated:2014.02.13
Status:Open Resolved:
Product:iOS Product Version:iOS7
Classification:Crash / Hang / Data Loss Reproducible:Sometimes
 
Summary:
I expreience the same problem that is described here : https://devforums.apple.com/message/920302#920302 .

(I know that there are a lot of grammar issues in these forum entries but) I hope you don't mind if I quote from the developer's forum to describe the problem : 

"I'm upgrading my app to iOS7 and i want sent text message programmatically, with iOS 6 all works fine, but with iOS 7 i have an issue.

i use this code for open the message composer

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
    if (messageClass != nil && [messageClass canSendText])
    {
        MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
        picker.messageComposeDelegate = self;
        picker.recipients = //MY PHONE NUMBERS ARRAY;
        [self presentViewController:picker animated:YES completion:nil];
    }

the iPhone display compose view with all contacts correctly inserted, but if i try to send, seem to be all ok but SMS don't sent.
 
in messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult: result is MessageComposeResultSent"

"We are seeing this happen frequently.  It seems to happen on 5s models more than others, but this could be just chance as it has been reported on most models at one point or another.

Seems to be happening more when the sms is to a number that the phone has never sent a message to before.  In this case there is a record of the new phone number in iMessage at the top of the log, but no message, the message screen is blank.

We are also getting a MessageComposeResultSent result in our callback.  On failure, there is no sound being made after the "Send" button is pressed.

...

Note:

Restarting the phone also seems to solved the problem, but we have no way of handling the failure to send and notifying the user."

Steps to Reproduce:
Try to send a message using MFMessageComposeViewController .

Expected Results:
Message is sent

Actual Results:
Message is not sent

Version:
iOS7 (all current live and beta versions)

Notes:


Configuration:
iOS7 (all current live and beta versions), all iPhone versions

Comments

Here is, a not wholly satisfactory hack, around this

You can just launch the Message app. It goes around this problem, but then of course your app is no longer the active one:

let phoneURLString = "sms:5555555555" let phoneURL = NSURL(string: phoneURLString) UIApplication.sharedApplication().openURL(phoneURL)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!