Giter Club home page Giter Club logo

Comments (9)

dozel avatar dozel commented on July 29, 2024

Can you share some of your code where you use this library?

from react-native-google-fit.

StasDoskalenko avatar StasDoskalenko commented on July 29, 2024

@reboss any updates?

from react-native-google-fit.

reboss avatar reboss commented on July 29, 2024

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?

from react-native-google-fit.

StasDoskalenko avatar StasDoskalenko commented on July 29, 2024

@reboss Hey! That would be awesome! Thanks!

from react-native-google-fit.

StasDoskalenko avatar StasDoskalenko commented on July 29, 2024

@reboss hey any updates? Maybe I can help you to move this functionality to production? It should be a really big step forward :)

from react-native-google-fit.

reboss avatar reboss commented on July 29, 2024

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 startFitnessRecording() and also adding some event handlers similar to how the authorize() function is set up.

from react-native-google-fit.

reboss avatar reboss commented on July 29, 2024

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 :)

from react-native-google-fit.

StasDoskalenko avatar StasDoskalenko commented on July 29, 2024

@reboss sure thanks!

from react-native-google-fit.

StasDoskalenko avatar StasDoskalenko commented on July 29, 2024

@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
    }

from react-native-google-fit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.