iPhone 开发人员 - 如何从应用程序内拨打电话号码?另外,如何从应用程序内挂断电话?

发布于 2024-11-27 09:07:45 字数 136 浏览 4 评论 0原文

这是两个基本问题。首先,我需要知道是否可以在我的应用程序中以编程方式挂断电话(例如,当用户按下按钮时)。另外,是否可以在我的应用程序内拨打电话,而无需离开我的应用程序?例如,用户可以通过电话交谈,但仍然始终看到我的应用程序的正面和中心?

谢谢

Those are the two basic questions. First of all, I need to know if it's even possible to programmatically hang-up the phone from within my app (when the user presses a button, for instance). Also, is it possible to make a call from within my app, without having to leave my app? As in, the user can talk on the phone, but still see my app front and center the whole time?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

日暮斜阳 2024-12-04 09:07:45

对这两个问题都说“不”*:这是不可能的,除非你走向黑暗面(越狱)。

要了解开发人员在电话功能方面可以使用哪些选项,请查看 核心电话文档

  • 您可以通过将 tel://%@ 类型的 url 传递给 [[UIApplication sharedApplication] openURL:url] 来传递电话,但您不能“停留”在应用程序本身中(电话.app 将负责接听电话)。

No to both questions*: it's not possible, unless you go to the dark side (jailbreak).

To know what kind of options are available to developers in regard to the phone functionality, take a look at Core Telephony's documentation.

  • You can pass a phone call by passing a url of the type tel://%@ to [[UIApplication sharedApplication] openURL:url] but you can't "stay" in the App itself (phone.app will take care of the phone call).
怎樣才叫好 2024-12-04 09:07:45

当您以编程方式拨打电话时,您的应用程序会跳转到电话应用程序。

您可以像这样拨打电话:

NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat:@"tel://%@", kSavedNumber]] autorelease];            
[[UIApplication sharedApplication] openURL:url]

一旦执行此操作,用户将不会在您的应用程序中,并且他们将使用标准电话界面挂断电话。

When you programmatically make a phone call, your app jumps into the phone app.

You can make a phone call like this:

NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat:@"tel://%@", kSavedNumber]] autorelease];            
[[UIApplication sharedApplication] openURL:url]

Once you do this, the user will not be in your app, and they will be hanging up using the standard phone interface.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文