Reputation: 411
My Watch app has list of contact and I want open initiate call from watch. like we do in iPhone device.
I have tried this solution but not working for.
Upvotes: 1
Views: 1692
Reputation: 87
Swift 4 / WatchOS 5
var phone = "1234567890"
if let telURL = URL(string: "tel:\(phone)") {
let wkExt = WKExtension.shared()
wkExt.openSystemURL(telURL)
}
Upvotes: 1
Reputation: 411
I have fixed it using following method
var phone = "123456"
if let telURL=NSURL(string:"tel:\(phone)") {
let wkExt=WKExtension.sharedExtension()
wkExtension.openSystemURL(telURL)
}
Upvotes: 3