0

I am finding some conflicting information about the feasibility of ios being able to let a user from within an app open the SMS dialog and have the text predefined/prepopulated. In android i think it is called "intents" but after some research I am coming up with not solid information about ios allowing the same.

Any confirmation and source would be greatly appreciated.

Quotient
  • 3,925
  • 6
  • 31
  • 35

1 Answers1

1

It's quite easy -

MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]) {
    controller.body = @"SMS TEXT";
    controller.recipients = [NSArray arrayWithObjects:@"1234567890", nil];
    controller.messageComposeDelegate = self;
    [self presentModalViewController:controller animated:YES];
}
Asaf
  • 2,158
  • 2
  • 25
  • 40