Artmin,
I have follower your example and all 9 steps. However, when the iMessage screen appears, it is always empty. Any thoughts on what I may have missed?
I am trying to send an image, a url, and text. They show in the iMessage screen if I add the url and text in the "set body()" and add the image via "attachment()". When I try to use MSMessage, and set the properties in the new 'message' property of MFMMessageComposeViewController, the iMessage screen is empty.
I have added the Message Extension and configured it similarly to my other app extension (Share Extension).
Here's my code.
if([MFMessageComposeViewController canSendText] && [MFMessageComposeViewController canSendAttachments]) {
if (url != nil) {
MSMessage *newMsg = [[MSMessage alloc]init];
newMsg.URL = url;
MSMessageTemplateLayout *msgLayout = [[MSMessageTemplateLayout alloc] init];
msgLayout.caption = @"Caption";
msgLayout.imageTitle = @"Title for Image";
msgLayout.image = image;
newMsg.layout = msgLayout;
MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
messageController.message = newMsg;
messageController.messageComposeDelegate = self;
[messageController setRecipients:nil];
[messageController setBody:@"body"];
/
[self presentViewController:messageController animated:YES completion:nil];
}
}