01-16-2019 13:08 - edited 01-16-2019 13:09
01-16-2019 13:08 - edited 01-16-2019 13:09
Im trying to make personalized version of the Fitbit sdk-exercise app example, allowing the user to select the exercise with the app settings menu. However, I am a bit stuck due to being novice to the layered constructors nature of the sdk-exercise example.
I would like to change the config.js file from "export const exerciseName = "run" " to an ExerciseName retrived from the settings/index.jsx. In the end, I keep just getting that the exercise returned is undefined.
I have created a Github Gist of the relevant code: Gist
Any help appreciated.
01-18-2019 16:55
01-18-2019 16:55
I don't have a full example, but if you take a look at the Alpine Snow app, you'll see the companion send a file to the device, and the device reads data from that file.
You could send your user selected exercise in a file:
Send a file to the device
https://github.com/orviwan/alpine-snow/blob/master/companion/index.js
Receive the file
https://github.com/orviwan/alpine-snow/blob/master/app/lib/incoming.js
Start listening for files
https://github.com/orviwan/alpine-snow/blob/master/app/index.js#L5
Read data from the file
https://github.com/orviwan/alpine-snow/blob/master/app/subviews/weather.js#L26
Then you can use the user selected exercise name when starting your exercise.
I hope it helps.