Wednesday, March 23, 2016

Pebble Steps to MyFitnessPal

Back in January, I described how I sync my Pebble step count into my Fitbit account instead of using my Fitbit tracker. This week, I started using MyFitnessPal (MFP) to track calorie intake and I now need to incorporate these steps for calorie adjustment. The Rube-Goldberg machine gets bigger...

My first hope lay in the fact that MyFitnessPal app claims to integrate with iOS HealthKit. Since my steps are already in HealthKit, it seemed natural that I would just pull them from there into the MFP app. That proved to be a bust. Despite the allusion that one could hook up that data synchronization, both my testing and later confirmation with technical support indicated that this is not possible. In fact, I have not even been able to reliably sync calories out of  MFP into HealthKit; I get a couple of food records to go out. The integration appears to be half-baked.

My second approach was to use the fact that SyncSolver is transferring steps from HealthKit to Fitbit. MFP provides a direct pull from Fitbit. I crossed my fingers that this would work since steps pushed into Fitbit externally have limitations in terms of how they can be used. The winds blew favorably today and the steps from Fitbit do, in fact, eventually get into MFP. The key is "eventually." Due to syncing limitation, I don't actually see the steps in Fitbit until after about a 2 hour delay. Last night, I ate a meager dinner to fit within my calories, only to discover, as I was going to bed, that I could have had a dinner twice as big.($#*^&#$^ diet. However, until Fitbit figures out how to disable this, it does work. As a bonus, our Aria scale weights can be pulled straight from Fitbit into MFP via the same on-line connection.

Next trick, getting workouts into MFP ... Again, my attempt at HealthKit integration was a bust. However, iSmoothRun itself came to the rescue. I configured it to push directly to MFP on-line at the same time that it pushes to Dropbox and SportTracks. In principle, I may get trapped double counting my walks as "steps" and "workouts", but I can choose whether to push activities to MFP when I save. I am thinking I will not push walks and hikes but will push cycling activities that don't count as steps.

My Rube-Goldberg now looks like this:

As another note, I had been frustrated that automatic synchronization by SyncSolver were almost never happening and that I was having to manually push Sync Now in the app each day. Not a big deal with the corporate 10k-a-Day accounting ... much bigger deal now that my dinner depends on it! After contacting the authors, I found that SyncSolver is only able to pull from HealthKit when the phone is unlocked. Furthermore, it can only automatically do so when it receives a "Background App Refresh" notification from iOS. It turns out that the odds that a notification occurs when the phone is unlocked is pretty low as there is no coordination of these events. It gets worse ... The iOS has a smart feature to "learn" how often the target app needs to be refreshed. Since it discovers that SyncSolver is not actually succeeding when notified, it decides to reduce the frequency that it allows SyncSolver to try running.

Awesome. I can't imagine why this Apple HealthKit is not catching on like wildfire. The core problem would seem to be HIPAA. This law was supposed to make client health data more portable. Instead, it prevents use of our own health information. The law notwithstanding, this Apple behavior puzzles me. If I unlock the phone, I can manually perform the synchronization. In doing so, I have to trust that SyncSolver does not abuse its access. I also had to unlock the phone to install and configure SyncSolver in the first place. So, what damn difference does it make if the app does the actual synchronization when the phone is locked or unlocked. The app is not like a criminal that acts differently when someone is watching. I am not yet seeing the logic here.

Update Mar 27 - After deleting SyncSolver (beta) and reinstalling the newest version (v2.2), I am once again getting occasional automatic pushes. Perhaps Apple "unlearned" the desired refresh rate.

No comments:

Post a Comment

Relevant comments and questions are welcome but submissions with spam-links will not be published.