Search code examples
iphoneiossendmfmessagecomposeviewcontroller

How to send a message in iPhone devices?


Currently i am working in iPhone application, Using MFMessageComposeViewController to develop this application and its working fine.

enter image description here

But i want, message compose screen don't show on the screen, then the Message send programmatically , How to do this? it is possible? please help me

I tried this:

MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
    if([MFMessageComposeViewController canSendText])
    {
        controller.body = @"Hi"; 
        controller.recipients = [NSArray arrayWithObjects:@"12345678", @"87654321", nil];
        controller.messageComposeDelegate = self;
        [self presentModalViewController:controller animated:YES];
    }

Solution

  • I've tried to do this once but but it wont be accepted by app store. Apple wont let you send message/email without user knowledge about it.