So I'm learning about updateApplicationContext the hard way here (mostly due to the fact that there it's extremely hard to debug what's happening on my phone app while running the watch app). The problem I have is this: If I say the following, I get regular updates:
try self.session.updateApplicationContext([MessageKey.LocationCount.rawValue: String(self.receivedLocationCount)])
(straight out of potloc)
If however I try this, I get no updates. I assume something has crashed but there are no logs to let me know:
//currentLocation is a CLLocation
try self.session.updateApplicationContext([MessageKey.LocationCount.rawValue: currentLocation])
My understanding is that I should be able to pass any object to updateApplicationContext, but passing a CLLocation seems to break it, whereas passing a String is fine. Interestingly if I do this, the call does in fact work (though I don't get what I want on the other end, as I want a CLLocation object):
try self.session.updateApplicationContext([MessageKey.LocationCount.rawValue: String(currentLocation)])
There is so little documentation I'm not sure how to go about solving this problem. I really wish potloc's code did smoething more than just pass a string, as it's not trivial to go from a string to a general object here.