self.extensionContext!.openURL open app but calls no method

1.7k views Asked by At

I am trying to wire the Today extensions to my app by using the following piece of code:

override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
    let selection=busCollection[indexPath.row];
    let palina=selection?.palina;
    let urlAsString = "widget://pathto/" + "\(palina)"
    let url = NSURL(string: urlAsString)
    self.extensionContext!.openURL(url!, completionHandler: { (success: Bool) -> Void in
            print("completed")
        }
    )
    tableView.deselectRowAtIndexPath(indexPath, animated: false)
}

Yet activating that method correctly opens my app but launches it in the standard way without calling:

-(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url

What may be the issue? Of course I registered my widget on the info.plist file, otherwise the app would probably not have been even opened.

1

There are 1 answers

0
Fabrizio Bartolomucci On BEST ANSWER

It did end up calling the delegate method.