My goal is to send a huge dictionary (containing about 10 arrays) from the iOS app to the watchKit app, but I'm not getting any output on the watchKit's end.
If I send a string, the following example works fine:
let message = [ "fromParent": "some string" ]
session.sendMessage(message, replyHandler: { replyDict in }, errorHandler: { error in })
but when I try to send a dictionary, I'm not getting any output at all:
let message = [ "fromParent": dictionary ]
session.sendMessage(message, replyHandler: { replyDict in }, errorHandler: { error in })
This is how I print out the output on the watchKit's end:
func session(session: WCSession, didReceiveMessage message: [String: AnyObject], replyHandler: [String: AnyObject] -> Void) {
guard let parentMessage = message["fromParent"] as? String else { return }
print(parentMessage)
}