Pregunta

I implemented in my app MFMessageComposeViewController for send sms. It works well, but I do not know if it is possible to know when the message is actually sent.

-(void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSArray *)recipients {

    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];

    if([MFMessageComposeViewController canSendText]) {

      controller.body = bodyOfMessage;    
      controller.recipients = recipients;
      controller.messageComposeDelegate = self;
      [self presentModalViewController:controller animated:YES];

    }
}

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {

  [self dismissModalViewControllerAnimated:YES];

  if (result == MessageComposeResultCancelled) {

    NSLog(@"Message cancelled");

  } else if (result == MessageComposeResultSent) {

    NSLog(@"Message sent");
  }

}

if (result == MessageComposeResultSent) corresponds only to the button "send" but not really a warning if the message has been sent. Do you know if there is some way to delegate or know if the SMS was sent or not?

Thanks a lot!

¿Fue útil?

Solución

To the best of my knowledge, as of iOS 5.0, it is not possible to retrieve a successful send of a message or a successful delivery. This is the same for MFMailComposeViewController.

As you see the MFMailComposeViewController is rather sparse.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top