Does the dialer number on iOS really need confirmation?

I use the following code to dial and test using my device. It doesn't seem to require confirmation , right?

NSURL *url = [NSURL URLWithString:@"tel://12345678"];
[[UIApplication sharedApplication] openURL:url];
+5
source share
3 answers

A confirmation is not required and is not displayed when executed programmatically. You will only see alertView in Safari if you click the number.

However, in my own experience, I find it more convenient for the client to see the dialog box so as not to accidentally call someone. People just use things in applications without even thinking, in which case it can be bad.

, :

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Call 12345678?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Call", nil];
[alert show];
alert.tag = 1;
[alert release];

-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    switch (alertView.tag) {
        case 1:
            if (buttonIndex == 1) {
                NSURL *url = [NSURL URLWithString:@"tel://12345678"];
                [[UIApplication sharedApplication] openURL:url];
            }
            break;
        default:
            break;
    }
}
+14

URL telprompt,

NSURL *url = [NSURL URLWithString@"telprompt://12345678"];
[[UIApplication sharedApplication] openURL:url];
+18

All Articles