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!
source share