I am trying to send information from my WatchKit App over to my main parent application and from what I understand I should just be able to use openParentApplication
in my watchkit Extension which will be received by handleWatchKitExtensionRequest
in AppDelegate.swift, but I cant seem to get handleWatchKitExtensionRequest
to be triggered.
I've been having some issues, so at this point I'm just trying to establish any connection at all before worrying about what information is actually passed. so currently in my Watchkit ViewController I have the following:
let testDict = [
"value1" : "Test 1",
"value2" : "Test 2"
]
@IBAction func saveButtonFunction() {
openParentAppForBalance(testDict)
}
private func openParentAppForInfo(Dict: [String: String]) {
WKInterfaceController.openParentApplication(testDict,
reply: {(reply, error) -> Void in
println("openParentApplication called in button function")
})
}
which shows in the output that the function is being called, but handleWatchKitExtensionRequest
just wont respond. Currently it's set to the following in AppDelegate.swift which never gets called:
func application(application: UIApplication!, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) -> Void)!) {
println("we made it!")
var retValues = Dictionary<String,String>()
retValues["retval1"] = "return Test 1"
retValues["retval1"] = "return Test 2"
reply(retValues)
}
I'm sure I'm probably just missing something really fundamental here in my understanding of how this all works, but any help at all about how to get handleWatchKitExtensionRequest
to be triggered would be hugely appreciated!