MFMessageComposeViewController iOS7 addAttachmentData:typeIdentifier:filename: not working

The MFMessageComposeViewController wants the attachment to have the correct extension for the type of image you're uploading. I verified by testing with a PNG file, and the following variations of adding the attachment data:

[messageController addAttachmentData:imgData typeIdentifier:@"public.data" filename:@"image"];
[messageController addAttachmentData:imgData typeIdentifier:@"public.data" filename:@"image.abc"];
[messageController addAttachmentData:imgData typeIdentifier:@"public.data" filename:@"image.png"];

Only the last option worked. I didn't need to change the typeIdentifier, although it probably would make sense to choose a UTI that matches the type of data.

The full list of UTIs is available here: System-Declared Uniform Type Identifiers (Thanks @iWasRobbed!)