I send SMS programmatically so for a long time. It worked without any problems in iOS6.
But now, after upgrading to iOS7, some users have problems with the application. They must uninstall the application - restart the iPhone - reinstall it, and then it works. Just reinstalling it without restarting the phone also does not work.
What could be causing this really annoying problem?
In addition, there are several cases where they can send multiple SMSs after this procedure, but then the iPhone SMS-Dialog appears very slowly and no SMS is sent again until they restart the iPhone. Just terminating and restarting the application does not help.
Here is the normal SMS code:
MFMessageComposeViewController *messageVC = [[MFMessageComposeViewController alloc] init]; [messageVC setMessageComposeDelegate:self]; if ([MFMessageComposeViewController canSendText]) { NSString *smsString = [NSString stringWithFormat:@"bla bla bla"]; messageVC.body = smsString; messageVC.recipients = @[userPhone]; messageVC.messageComposeDelegate = self; [self presentViewController:messageVC animated:YES completion:nil]; }
I even released a new version of the application with the latest Xcode 5.0 with the goal of deploying 5.1, since I still need to support iOS5.1 users.
source share