Replacing tel or telprompt to call

前端 未结 3 1713
情书的邮戳
情书的邮戳 2021-01-16 03:39

I\'ve made an application is used to call predefined numbers upon button press. As far as i know the only way to make call inside app is to use \"tel\" or \"telprompt\". Whe

3条回答
  •  攒了一身酷
    2021-01-16 04:02

    Use following code:

    NSString *phoneNumber = @"+91 2308966";
    NSString *phoneURLString = [NSString stringWithFormat:@"tel:%@", phoneNumber];
    NSURL *phoneURL = [NSURL URLWithString:phoneURLString];
    [[UIApplication sharedApplication] openURL:phoneURL];
    

    This code is working for an app which I submitted to the Appstore.

提交回复
热议问题