iOS 中拨打电话

iOS 10以前

    NSString *phoneStr = [NSString stringWithFormat:@"telprompt://%@",@"18150830596"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneStr]];

iOS 10以后

    NSString *phoneStr = [NSString stringWithFormat:@"telprompt://%@",@"18150830596"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneStr]
                                       options:@{}
                             completionHandler:^(BOOL success) {
        NSLog(@"success");
    }];

posted @ 2021-03-02 15:11  1lin24  阅读(162)  评论(0编辑  收藏  举报