App应用中拨打电话

来源:互联网 发布:淘宝有多少家婚纱店铺 编辑:程序博客网 时间:2024/04/26 08:02

在通过APP里有电话号码,可以能用苹果API进行拨打电话,但是不同的API方法,会造成不同的情况出现,如在挂完电话后当前APP会退出。


方法1 拨打完电话后退出当前APP,需要重新进入

NSString *phoneNumString = [NSString stringWithFormat:@"tel://%@", @"13800138000"];[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumString]];


方法2 拨打完电话后返回当前APP

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


0 0