我正在尝试使用我的应用调用电话
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://1800000002"]];
This is a toll free number in India.But while dialing, it is converting to +1(800)-000-000 (Converting and Saying dialing to United states number)
我提到了Copy/paste phone number into keypad和 When I'm redialing a Toll free No. in India, iPhone is connecting USA ].但找不到解决方案。
所以请任何人帮我避免这个 ISD 调用印度本地电话..
最佳答案
电话提示需要国际格式的号码。所以你需要把它转换成那个。我认为对于印度和您要调用的号码,这应该是 +911800000002
。
所以这应该可行:
NSURL *phoneURL = [NSURL URLWithString:@"telprompt://+911800000002"];
if ([[UIApplication sharedApplication] canOpenURL:phoneURL]) {
[[UIApplication sharedApplication] openURL:phoneURL];
} else {
// handle that case. e.g show number to user so that they can
// type it in a phone manually or copy it to the clipboard and
// notify user about that.
}
根据本地号码与国际格式相比在印度的运作方式,您可能需要删除号码上的 1
,对此我不确定。
旁注:处理电话号码时应始终使用国际格式。否则,当前位于目的地国家/地区之外的设备可能会调用其他人或根本无法调用电话。
关于ios - 将电话号码复制/粘贴到键盘或以编程方式在 iOS 中调用免费电话号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36938496/