When sending email, if I set MFMailComposeViewController
recipients using standard RFC822 recipient format with "name" , MFMailComposeViewController
will format recipients in the view to show the names with the email addresses hidden. So doing this:
MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
NSArray *recipients = [NSArray arrayWithObjects:
@"\"Bob Paulsen"\ <[email protected]>",
@"\"Sally"\ <[email protected]>", nil
];
[composer setToRecipients:recipients];
results in this:
My question is: Is there a magic format I can use to do the same thing in with SMS recipients in MFMessageComposeViewController? I tried using the same format as email but it includes all the text (name and number) in the recipient field. I've tried a few other permutations but so far haven't lucked onto a solution.
The only way to do this would be in add a new contact with the recipient number into the user's address book. See the ABAddressBookAddRecord function in the ABAddressBook framework.
However, make sure your users know that this is happening and are OK with it...