从 iPhone 应用程序拨打电话
我现在有点被欺骗了,所以我需要一些帮助。我有一个 iPhone 应用程序,我希望能够在该应用程序中拨打一个号码。 (希望这是可能的?)
我有点困惑。它有一个电话号码:XXXXXXXX,但在 Objective C 和 iPhone sdk 中,你能只有一个简单的链接吗?
现在我正在尝试使用以下内容:
[[UIApplication sharedApplication] openUrl:[NSURL URLWithString:@"tel:#######"]];
(##### 是我出于测试目的硬编码的第二个电话号码)
提前致谢。
I am getting a little tricked up right now so I need some help. I have an iPhone app and within the app I want to be able to call a number. (Hopefully this is possible?)
I have looked at:
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html
and I am a little confused. It has an with the tel:XXXXXXXX but in objective c and the iPhone sdk can you have just a plain link??
Right now I am trying to use something along the lines of the following:
[[UIApplication sharedApplication] openUrl:[NSURL URLWithString:@"tel:#######"]];
(the ##### is a my second phone number hardcoded in for testing purposes)
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你所拥有的应该可以工作,但不能在模拟器中
what you have should work, but NOT in the simulator
我不确定你具体要问什么。您那里的代码应该启动他们的拨号器。
I'm not sure what your asking specifically. The code you have there should launch their dialer.
是的,这可以在物理手机上工作,但在模拟器中不起作用......我不明白你的问题是什么。
Yeah, that will work on a physical phone but it won't work in the simulator.... I don't understand what your question/problem is.