I think you should use the code below. because by default the jpeg image type for png images does not appear in iMessage when trying to insert.
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"aa1" ofType:@"png"]]; [pasteboard setData:data forPasteboardType:@"public.png"];
// or if the image is jpeg, then under the code
[pasteboard setData:data forPasteboardType:@"public.jpeg"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:45263125"]];
source share