4

I'm using MFMessageComposeViewController in my iOS app.

MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]){
    controller.body = text;
    controller.recipients = [NSArray arrayWithObjects:recipient,nil];
    controller.messageComposeDelegate = self.navigationController;
    [self.navigationController presentViewController:controller animated:YES];
}

-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
[self dismissModalViewControllerAnimated:YES];
}

Button "send message" is blue. If you send message not to the iMessage user, iPhone send sms not iMessage, but on some devices(iPhone 4, 5) operation fails. After that error you can't send messages to the user at all !!! using standard sms application in iPhone.

Deletion of contact, reboot, switching off iMessage doesn't solve this problem. MFMessageComposeViewController kills sms sending and we can't solve this issue. We have iOS 6.1.3 version on out test devices.

  • Are you sure you mean to set the messageComposeDelegate to the navigation controller? That will only do something reasonable if you've subclassed a navigation controller. Probably won't solve the problem though, as that seems much more like an Apple bug. – David Doyle Aug 30 '13 at 13:55

1 Answers1

0

try

controller.messageComposeDelegate = self;
Aks
  • 101
  • 1
  • 9