Reputation: 21
My code is
let url = NSURL(string: "https://www.google.com")
WKExtension.shared().openSystemURL(url! as URL)
but I am getting popup message "URL failed to load This URL can be viewed on your iPhone"
Please suggest any way to open url in watch application.
Upvotes: 2
Views: 1124
Reputation: 56
The documentation of the openSystemURL(_:) method clearly states that the URL supplied to it has to support the tel: or sms: scheme and can only be used for starting a phone call or writing messages. It cannot be used to open any other applications, especially not 3rd party ones.
watchOS doesn't support URL schemes at the moment (as of watchOS 5), unlike iOS, so you won't be able to open other apps from your app's WatchKit Extension.
you can check the apple documentation from below link Apple documentation
Upvotes: 3