dimanche 30 novembre 2014

iPhone: getting a call status

When sending an email we can get a status for the user action if the email went through, was cancelled, error etc. (sms has the same functionality with different function)



- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
NSString* mailResult;
switch (result)
{
case MFMailComposeResultCancelled:
mailResult = @"e-mail cancelled";
break;
case MFMailComposeResultSaved:
mailResult = @"e-mail saved";
break;
case MFMailComposeResultSent:
mailResult = @"e-mail sent";
break;
case MFMailComposeResultFailed:
mailResult = @"e-mail sent failure: %@", [error localizedDescription];
break;
default:
break;
}


is there something simillar for phone calls? because the system "phone call" message box has a call & cancel button and I wish to know when the user pressed cancel.



[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@",self.phoneNumber]]];



Aucun commentaire:

Enregistrer un commentaire