Reputation: 11175
I have just added a today widget to my app and I am trying to allow users to tap on the widget to launch it's containing app.
Basically at the moment I have a button over the top of my widget which is linked to this function:
@IBAction func launchApp(sender: AnyObject) {
var url: NSURL = NSURL.URLWithString("AppName://home")
self.extensionContext.openURL(url, completionHandler: nil)
}
When I run the app and tap on the widget I get an alert view that states:
Unsupported URL - This URL wasn't loaded: AppName://home
Where am I going wrong?
Upvotes: 5
Views: 2127