我正在编写一个 iPhone 应用程序,它需要有一个选项来调用我们的办公室。但是,需要调用的电话号码有一个 5 位数的分机号。
我知道要调用普通电话号码,我们可以使用 openURL
,方法如下:
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"tel:1-800-555-5555"]];
我可以让它与扩展一起使用吗?如果是,怎么办?
Apple docs链接到 RFC 2806 ,它描述了 tel:
的 URL 方案,似乎支持扩展,但我无法从 RFC 中找出语法。
不能 100% 确定这是否是答案,但来自您在第 14 页链接的 RFC:
tel:+358-555-1234567;postd=pp22
The above URL instructs the local entity to place a voice call to
+358-555-1234567, then wait for an implementation-dependent time (for
example, two seconds) and emit two DTMF dialing tones "2" on the line
(for example, to choose a particular extension number, or to invoke a
particular service).
希望这对您有所帮助。