Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 0 replies
95
Views
Smoothwalker Network
Hi everyone,
I'm looking for help understanding the structure of the Smoothwalker HealthKit demo from WWDC2020. I'm an experienced coder but I'm fairly new to swift + HealthKit.
Long story short: I'm creating an app that will draw Health data from HealthKit (e.g. steps, distanceWalked) and push the data to an external server/ database. From there I'll be performing analytics to give my users recommendations about their activity.
The MobilityChartDataViewController page is a huge help - it demonstrates the use of an HKAnchoredObjectQuery - HKStatisticsCollectionQuery to generate only any updated statistics to push to the 'Network' for efficiency purposes.
This is exactly how I'd like my app to behave, but I need help working out what 'Network' is at present in this demo, and how I can replace it with my own external server.
I can't work out where the insane of the 'Network' class is being initialised, or really where the data is being pushed to at present. The demo gives console lines like:
Pushing 1 new samples to server!
Samples: ["HKQuantityTypeIdentifierStepCount": 1]
This sounds great, but where is it going? I imagine its being stored locally at present, but I'd love to hear how is best to move it external.
Many thanks for your help!