在iphone中如何在xcode中检查呼叫是否成功?
我必须检查通过代码拨打某个号码是否成功,如果没有,那么我必须再次拨打另一个号码......
-(IBAction)callPhone:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:2135554321"]];
}
i have to check that whether a call made on a number by code is success or not ,if not then i have to make another call on another number.....
-(IBAction)callPhone:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:2135554321"]];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以参考 CoreTelephony 框架 (CTCall 类参考)。该类有一个属性
callState
,它返回蜂窝呼叫的状态,即拨号、传入、连接或断开连接。You can refer CoreTelephony Framework (CTCall Class Reference).This class has a property
callState
that returns states of cellular calls i.e. dialing, incoming, connected, or disconnected.你不能。 Apple 根本不会向您提供任何有关通话的信息。您不知道手机是否确实尝试过拨打电话(如果 URL 无效或发生其他错误,
openURL:
可能会返回 NO)。这是设计使然,旨在保护用户的隐私。
You cannot. Apple does not provide you any information about calls at all. You won't know whether the phone actually tried making the call (other than
openURL:
might return NO if the URL was invalid or some other error occurred).This is by design and intended to protect the users' privacy.