Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Myroslav
    @MyroslavKoval1999
    here is my code
    image.png
    image.png
    Thanks for any answer
    Ransoy
    @Ransoy
    Hi guys, when use the latest getSleepSamples function I encounter this warning

    the user must be signed in to make this api call,
    However, the authResult is {"success":true}, not sure why it says the user is not logged in.
    any idea what i missed

    here is my code

    sleepdata.png
    aboveyunhai
    @aboveyunhai
    @Ransoy if you are able to change your package android source file change the https://github.com/StasDoskalenko/react-native-google-fit/blob/9a43114f04d12bdeb376e6f14580311362b7a35f/android/src/main/java/com/reactnative/googlefit/SleepHistory.java#L127
    from DataType.TYPE_ACTIVITY_SEGMENT to DataType.TYPE_SLEEP_SEGMENT
    then rebuild your project to see if it works
    i probably forget to change that part, but i wonder if that's the issue before I push the fix
    Ransoy
    @Ransoy

    @aboveyunhai thanks for the reply,i followed your instruction, still got the error message,
    but i just wonder in this line Scopes.FITNESS_NUTRITION_READ
    https://github.com/StasDoskalenko/react-native-google-fit/blob/9a43114f04d12bdeb376e6f14580311362b7a35f/android/src/main/java/com/reactnative/googlefit/SleepHistory.java#L78

    when i add the scope in authorize function it works !

    Martin Fulop
    @krakz999
    Hi guys, is it possible to track and/or get "floors climbed" data from Google Fit? All I could find is an activity name called "stair climbing" but in Google Fit it doesn't actually allow to set an actual value of stairs climbed for the activity, only calories and steps.
    aboveyunhai
    @aboveyunhai
    @Ransoy good catch, let me check out both
    danutz30
    @danutz30
    Hello @aboveyunhai I'm using in my react-native app this library. When I request data from GoogleFit.getDailyStepCountSamples(opt)
    .then((res) => {
    console.log('Daily steps >>> ', res)
    }). In the then part nothing is executed. Basically the promise is not reacting anyway
    Zi
    @zinaida2mc
    Hi, I updated to 0.16.1 and got a lot of issues with SleepHistory.java so I even can't run my app. Please help
    akjesto
    @akjesto
    Hi, is this react-native-google-fit library support iOS?
    aboveyunhai
    @aboveyunhai
    nope´╝îi believe there is a react native health kit api for ios part. You can install both to maximize flexibility. I had seen some packages that combine both, it made your development easier but lost customization for each platform. Really depends on what you need.
    Taha Mazari
    @TahaMazari_twitter
    Hey there! I Just wanted to know whether there is a method to retrieve the source which sends data to the health app. I mean if I have a Samsung Gear watch, and want to check the device which was used to gather this data, is it possible that the existing react-native-google-fit package will tell me that a Samsung watch was used to collect this data?
    aboveyunhai
    @aboveyunhai
    @TahaMazari_twitter good question, i believe it's dobale but probably the current implementation just miss the field, i can check it later.
    aboveyunhai
    @aboveyunhai
    @TahaMazari_twitter just a quick feedback from my test, it's not reliable but you can get the device info, and it's probably not that useful in real practice. Based on my personal understanding, google fit store manages data in some ways so you can retrieve it by given a time range and a bucket.
    The problem is that when you give a large time span ( for example, a day ), the data is from several devices, google fit api cannot distinguish the data source with one single big data. Of course, you can chuck down the data into small time span like 15min, but no matter how you chuck it down, it can be still mixed with multiple devices and you are never going to be satisficed.
    Also, always remember the constraint of one single dataset request limitation is roughly around 2500-3000 based on my own experience. Chuck down to 15min at maximum can give you (24h 4 each hour = 96) . 1 month data (30 96) at minimum may crush your app.
    Now Imagine your chuck down your data into 1s instead for the best accuracy, in worse case 1 hour data from 1 single request without concern can kill your app.
    You probably don't want to do that.
    Suphasit
    @shinichiz1
    Capture.PNG
    Can I ask some question? I don't know why this occur when I use Googlefit.authorize function it return that "null is not an object (evaluating 'googleFit.isAuthorized)"
    1 reply
    jaikantshikray
    @jaikantshikray
    Antoine OuiRun
    @antoinedelp
    Hello everyone, we are starting to observe crashes on our app when using R
    when using RN Google Fit. we did not have those crashes before, they are the following : 'com.facebook.react.bridge.ReadableNativeMap cannot be cast to java.lang.Double'
    I can't reproduce the issue on my device. It seems this issue could be linked to Android 10. Does anyone have experienced the same?
    enestatli
    @enestatli
    Hello, I am currently using version 0.14.0 what should I do follow recent updates for Google Fit Policies?
    aboveyunhai
    @aboveyunhai
    @enestatli It's unclear for me if they are going to enforce the change regardless the Fitness version. If so, you most likely have to upgrade your version to newest. But there are quite a bit of things for you to upgrade since the latest version drop most of callback functions, and change to async/await syntax. Also some new scopes is required for some functions.
    One thing I also found out it's that minSDK version should change to 24 due to some implementations for sleeps, which means you have to give up android 6.0 and below. It could be critical for some apps.
    enestatli
    @enestatli

    @aboveyunhai Hello, thanks for replying me back! I am worrying about the installing following SDK tools to my project;

    Android Support Repository, Android Support Library, Google Repository, Google Play APK Expansion Library

    Aren't they already in maven? Should I do another installation?

    And, also, when I call GoogleFit with the FITNESS_BODY_READ scope, the OAuth2(consent screen) says "Your APP needs permissions to.......body measurements and hearth rate.......". Heart rate permission should not be in the popup right? Because after new updates of Google Fit, now Heart rate has its own scope. I am concern about this.

    Thanks for the tips!

    aboveyunhai
    @aboveyunhai
    @enestatli I don't think you need to install any extra tools. But for other things you need to test it out locally by yourself
    enestatli
    @enestatli
    @aboveyunhai So can you please update the installation.MD :)
    I am trying test locally and kept getting same popup lol
    enestatli
    @enestatli
    Hello all, is there a way to write calories?
    hamzapiri
    @hamzapiri
    hi, can i use this lib in expo ?
    aboveyunhai
    @aboveyunhai

    hi, can i use this lib in expo ?

    you can use any native modules in expo bareflow. But there are some drawbacks. You need to check expo doc by yourself.

    ROBERT LI
    @lclrobert2020_gitlab
    Hi there, I would like to ask some questions about this package
    Does anyone know whats the difference between the step count of com.google.android.gms:merge_step_deltas and com.google.android.gms:estimated_steps?
    I read some article said merge_step_deltas merge the step count of different sources, but i am not sure what it means
    Also, i found out that there is a day which has not step data, but Google Fit app shows food step for that day, can anyone give me some hints on why this happen?
    aboveyunhai
    @aboveyunhai

    Hi there, I would like to ask some questions about this package
    Does anyone know whats the difference between the step count of com.google.android.gms:merge_step_deltas and com.google.android.gms:estimated_steps?
    I read some article said merge_step_deltas merge the step count of different sources, but i am not sure what it means
    Also, i found out that there is a day which has not step data, but Google Fit app shows food step for that day, can anyone give me some hints on why this happen?

    Different sources literally means the data can be from different devices like watch, mobile phone, etc. (imagine if you have two phones with app installed)
    I don't know about food step, but it can be from the estimation of manually added activity

    Lisa
    @lloncham
    Hey guys, it's been three days thats i try to use this library, i create my OAuth 2.0, change my google-services.json, add the implement and the apply plugin lines in my build.gradle but still have this error '_reactNativeGoogleFit.default.checkIsAuthorized' is undefined. The only thing that I haven't is the validation by google... could be because of that?
    aboveyunhai
    @aboveyunhai
    @lloncham I just create a quick walkthrough in documentation since a lot of people were asking the same problem over and over again
    If anyone didn't know how to do the authentication. just check the walkthrough step.
    I just quickly create a working sample based on it.
    Lisa
    @lloncham
    Thanks @aboveyunhai ! I just checked and everything has been done ... I don't know if react native fitness work at the same way but this library is working. My app is already publish then I can't add myself as a user tester, but should work even with that, right?
    solvd-mmelnyk
    @solvd-mmelnyk
    hey!
    can we somehow ask user to install Google Fit application if user does not have it on device?
    aboveyunhai
    @aboveyunhai
    @solvd-mmelnyk use deep link to open app store.
    solvd-mmelnyk
    @solvd-mmelnyk
    @aboveyunhai how can I know if Google Fit installed or no?
    Lloyd Dsouza
    @write2lloyd_twitter
    Hello everyone, I'm using this lib in an app to return Steps, Exercise and Sleep. It works great. There is one issue with Exercise though. If I delete an Exercise session in the Google Fit App, the getActivitySamples functions still returns that deleted session. Did a lot of searching but could not find if this is Google caching data on their servers or something else. Any clarity on this would be appreciated.
    Lloyd Dsouza
    @write2lloyd_twitter
    Seems like the deleted activity comes back as activityName = 'still' . So for now Im filtering it from the results for now.
    aboveyunhai
    @aboveyunhai
    @write2lloyd_twitter
    I cannot confirm whether the problem is from our code or Google Side, but since you mention it becomes still (not moving). I suspect that the problem might be, we enter a activity, which may include calories or Google Fit generate calories based on some prediction model. Then we delete the activity. Those calories still exists so it somehow fallback or categorized to still or unknown? Just my personal guess, can be the problem from code though. But you can use google Rest playground Api to check it out.