I realized that iOS9 adds a line break after the attachment when trying to send a SMS with MFMessageComposeViewController
.
It's a problem as our SMS receiver is parsing the input characters to route it to an the correct mail inbox. We're using a text prefix, and it's not working.
It works perfectly fine in iOS 8. Snippet below where the problem occurs.
combined = @"ABC TIPS";
messageVC.recipients = @"123456789";
messageVC.messageComposeDelegate = self;
[messageVC setBody:combined];
UIImage *myImage = image;
NSData *imgData = UIImagePNGRepresentation(myImage);
if (image != NULL){
// Present message view controller on screen
[messageVC addAttachmentData:imgData typeIdentifier:@"public.png" filename:@"image.png"];
[self presentViewController:messageVC animated:YES completion:nil];
}
In iOS8 the message is composed in to: attachment - body
But iOS9 seems to compose it to: attachment - new line - body
I want to remove the "new line" part... Any takes on what we can do (besides rewriting in to not use SMS)?