Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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.
    Airat Galiullin
    @galiullin_airat_twitter
    @StasDoskalenko Hi, is it possible to write a mindfulness data with your framework?
    aboveyunhai
    @aboveyunhai
    @galiullin_airat_twitter do you mean meditation?
    Airat Galiullin
    @galiullin_airat_twitter
    @aboveyunhai yes
    aboveyunhai
    @aboveyunhai
    @galiullin_airat_twitter currently no, if you ever check issues, there are many related to create activity data including meditation, etc. I'm actually on the feature and it's going to be the next release. But I'm currently busy with other projects.
    chamile
    @chamile
    Hi guys, I'm facing this strange message after doing all those installation steps correctly, can anybody give me some insights AUTH_DENIED. {
    "success": false,
    "message": "Authorization cancelled"
    }
    Soham
    @shmkane

    Asked this question in a Github issue but thought I'd pitch it here too.

    Currently, I can only read heart rate going back a couple weeks. I found a stackoverflow post that said to go further back you need to make use of enableServerQueries.

    I was wondering if this is already a feature of react-native-google-fit or if it would have to be requested/made?

    jsriganesh
    @jsriganesh
    Hi guys ... i have integrate the google fit and i have select the my primary mail id Then ... screen is continuously loading
    WhatsApp Image 2021-10-08 at 10.35.33.jpeg
    jsriganesh
    @jsriganesh
    {"message": "Authorization cancelled", "success": false}
    sykenrussel
    @sykenrussel
    Hi I tried doing the npm install as well as import GoogleFit, { Scopes } from 'react-native-google-fit'; but the authorization is still false
    sykenrussel
    @sykenrussel
    @aboveyunhai

    const opt = {
    startDate: "2017-01-01T00:00:17.971Z", // required ISO8601Timestamp
    endDate: new Date().toISOString(), // required ISO8601Timestamp
    bucketUnit: "DAY", // optional - default "DAY". Valid values: "NANOSECOND" | "MICROSECOND" | "MILLISECOND" | "SECOND" | "MINUTE" | "HOUR" | "DAY"
    bucketInterval: 1, // optional - default 1.
    };
    async function fetchData() {
    const res = await GoogleFit.getDailyStepCountSamples(opt);
    console.log(res);
    }
    fetchData();

    This is my simple code but I get attempt to invoke virtual method. I tried looking at this git thread: StasDoskalenko/react-native-google-fit#20 but it doesnt mention how to fix it even with authorization.

    aboveyunhai
    @aboveyunhai
    @sykenrussel My best guess it to try to safely wrap your function inside Auth check. Individual call without auth check can fail or be interrupted under any circumstances.
    const auth = await GoogleFit.authorize(options);
    if (auth.success or auth) {
     call your function here
    }
    sykenrussel
    @sykenrussel
    @aboveyunhai thanks that works now! Would have been better if that was mentioned in the documentation haha
    image.png
    @aboveyunhai is it also normal that the output is like this?
    [{"activityName": "unknown", "device": "", "end": 1636331399095, "sourceId": "", "sourceName": "", "start": 1483228817971, "tracked": true}] [{"rawSteps": [], "source": "com.google.android.gms:estimated_steps", "steps": []}, {"rawSteps": [], "source": "com.google.android.gms:merge_step_deltas", "steps": []}, {"rawSteps": [], "source": "com.xiaomi.hm.health", "steps": []}]
    I am using android virtual emulator so would that be a possible cause?
    sykenrussel
    @sykenrussel
    I also get empty arrays even if I had set the options to minutes and the intervals to 15 as was mentioned here: StasDoskalenko/react-native-google-fit#207
    aboveyunhai
    @aboveyunhai
    @sykenrussel it's expected the result you would get. You need to try it in real device to record at least some data. Existing data that aren't from your app wouldn't be caught ussually