下面方法将会弹出一个alertSheet表单并让客户选择是否拨打电话
- (void)showMessage
{
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"联系客服" message:@"\n客服电话:123456" preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction * actionCall = [UIAlertAction actionWithTitle:@"拨 打" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
#warning 打开下面代码 并修改客服电话
// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://这里换成客服电话"]];
}];
UIAlertAction * actionCancel = [UIAlertAction actionWithTitle:@"返 回" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}];
[alertController addAction:actionCall];
[alertController addAction:actionCancel];
[self presentViewController:alertController animated:YES completion:nil];
}