-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using react-native-google-fit with Google Fit SDK #26
Comments
Can you share some of your code where you use this library? |
@reboss any updates? |
Hey, sorry for the late reply. Yes, I think the problem described above was due to a conflict in our gradle configs. I was compiling a different version of the Google Fit SDK than this package was. It's all fixed now though. I did some more research into the Google Fit SDK and have found that in order to get fitness tracking to work without having the app itself installed, you have to initialize the Recording API. Then you can read fitness history without having any third party apps. I got this working in the app that I'm developing using React's Native Modules, similarly to how this package was built. I'm hoping to make a PR in the next week or two if you guys are willing to look at it? |
@reboss Hey! That would be awesome! Thanks! |
@reboss hey any updates? Maybe I can help you to move this functionality to production? It should be a really big step forward :) |
Hey @StasDoskalenko, I added the basic Recording API functionality in my fork if you want to take a look. I still need to test it and I wanted to add a little bit more functionality like allowing an array of fitness types to subscribe to to be passed as parameters to |
If you want, I'll make a PR as soon as I get a chance to test it, although I'm going to a Hackathon this weekend so I should be able to complete everything then :) |
@reboss sure thanks! |
@reboss hey! I've just merged your PR and added some changes. For example, I've added listeners directly to the lib. Because many of guys using this lib are using callbacks and it's more easy to them. You did a great job, thanks! startRecording(callback) {
googleFit.startFitnessRecording();
DeviceEventEmitter.addListener(
'STEP_RECORDING',
(steps) => callback(steps));
DeviceEventEmitter.addListener(
'DISTANCE_RECORDING',
(distance) => callback(distance));
// TODO: add mote activity listeners
} |
Hello again,
I tried to include the Google Fit SDK with my project and now I'm getting some errors when trying to interact with this package:
The lines referenced are:
I assume that if react-native-google-fit can communicate with the Google Fit App when I have it installed it should also be able to communicate with the SDK in much the same way. Do you know how I can fix this? If pointed in the right direction I could try to make a PR.
Thanks.
The text was updated successfully, but these errors were encountered: