MFMessageComposeViewController opens MMS editing instead of SMS and 'buddy name' text instead of telephone number

StackOverflow https://stackoverflow.com/questions/19951040

Question

I develop an IOS app with a feature, which sends SMS with a source code generated text to source code generated telephone recipients.

It works great for several months for ~hundred user, but now I got an interesting bug: when SMS UI appears, instead of the telephone number I pass to it, there is a "Buddy name" text and instead of SMS the message type is MMS. It happened on an IPhone 4 with IOS 7.

The way I use it (telephone number is an NSString):

NSArray* recipients = [NSArray arrayWithObject:telephoneNumber];

MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText])
{
    controller.body = message;
    controller.recipients = recipients;
    controller.messageComposeDelegate = self;
    [self presentViewController:controller animated:YES completion:nil];
}

Is there any more settings, method calling (...) to avoid this strange behaviour?

Thanks very much!

Was it helpful?

Solution

I encountered the same issue and found this question. Has this problem been resolved?

Thought it was an iOS 7 bug until I discovered an error on my part. I have added a string @"?" to recipients array instead of a phone number. When the message composer sees an invalid number, it displays "Buddy Name". After I corrected the error, "New Message" is displayed instead of "New MMS".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top