2

is there any possibility to send picture + text in iMessage in ios programatically?

if it is possible can anyone help me?

Jamie Taylor
  • 4,709
  • 5
  • 44
  • 66
ggg_1120
  • 398
  • 2
  • 19
  • This might help. http://stackoverflow.com/questions/19170516/mfmessagecomposeviewcontroller-ios7-addattachmentdatatypeidentifierfilename-n – sCha Feb 11 '14 at 10:58

1 Answers1

3

Yes you can do it , its same like doing for mail just do this

#import <MessageUI/MFMessageComposeViewController.h>

MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;

picker.recipients = [NSArray arrayWithObject:@"123456789"];   // your recipient number  or self for testing
picker.body = @"test from OS4";
NSData*imageData=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"image" ofType:@"png"]];
[picker addAttachmentData:imageData typeIdentifier:(NSString *)kUTTypePNG   filename:@"image.png"];
[self presentModalViewController:picker animated:YES];
Stan James
  • 2,535
  • 1
  • 28
  • 35
Rajjjjjj
  • 424
  • 3
  • 16