Submitted delegate MFMessageComposeViewController

I implemented in my application MFMessageComposeViewController to send sms. It works well, but I don’t know if it is possible to find out when the message is really 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 send button, but is not really a warning if the message was sent. Do you know if there is a way to delegate or know if an SMS was sent or not?

Thanks a lot!

+4
source share
1 answer

As far as I know, with iOS 5.0 it’s not possible to get a successful message sending or a successful delivery. This is the same for MFMailComposeViewController .

As you can see, MFMailComposeViewController is pretty meager.

+4
source

Source: https://habr.com/ru/post/1389905/


All Articles