使用OpenSystem API从Apple Watch打来的电话吗? [英] Phone call from Apple Watch with openSystem API?
本文介绍了使用OpenSystem API从Apple Watch打来的电话吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我观看WWDC 2015会议视频时为watchOS 2引入WatchKit" (在13:29),我看到可以使用openSystem API在Apple Watch上直接拨打电话.如何在Swift中使用此API?
As I watched the WWDC 2015 session video "Introducing WatchKit for watchOS 2" (at 13:29), I saw that it is possible to make phone calls directly on Apple Watch with the openSystem API. How can I use this API in Swift?
推荐答案
You can use the openSystemURL
method, which is available on the shared WKExtension
object. Pass a tel:
URL to this method to initiate a phone call.
if let telURL=NSURL(string:"tel:5553478") {
let wkExtension=WKExtension.sharedExtension()
wkExtension.openSystemURL(telURL)
}
这篇关于使用OpenSystem API从Apple Watch打来的电话吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文