将手机号码复制/粘贴到键盘中,或者在iOS程序中拨打免费电话号码

我正在尝试通过我的应用程序拨打电话
[[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 keypadWhen 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 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...