"Not connected to Health Connect"

DisastrousLark5 months ago

Always in react native , when get any data through SDK for google fit it throws error "Not connected to Health Connect" even manually permitted our app in health connect and sync health connect in google fit app

terra

Chandruadmin5 months ago

Hey there

This error could be caused by a number of issues, for example:

  1. If the sufficient permissions have not been configured in your apps manifest (follow this guide)
  2. You are building in Release mode and not debug mode, before getting approval to use Google Health data in production. To get permissions you will need to submit an application with this form
  3. The user has revoked health connect permissions on their end

Google Fit with REST API

However, the best way to get data from Google Fit is to use our Webhook API or our REST services as Google Fit is cloud based and data can be retrieved without the need for the SDK. You can authenticate a user by generating a Google Auth URL and then making a GET request for the data you would like, for example:

const options = { method: 'GET', headers: { accept: 'application/json', 'dev-id': '<YOUR-DEV-ID>' 'x-api-key': '<YOUR-API-KEY>' } }; const data = fetch(`https://api.tryterra.co/v2/activity?start_date=2024-05-01&to_webhook=false&with_samples=true&user_id=<USER-ID>`, options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));

Hope this has clarified your issue!


DisastrousLark5 months ago

I run in debug . In sdk , after allow all permission from health connect trigger by terra-react .still show error as "Not connected health connect". when use you given fetch method throws error as "GOOGLEFIT does not support REST API requests. Please request data within the SDK instead."


terra

Chandruadmin5 months ago

Hey

To clarify, the most optimal method for retrieving data from Google is to authenticate the users' Google account using our REST api services, either via our widget or our /authenticateUser?resource=GOOGLE endpoint. Both options will provide you a url that you can display in a webview or the browser.

This way, you can retrieve Google data without needing the SDK. The SDKs are the only option if you wish to retrieve data from Samsung and Apple Health.


DisastrousLark3 months ago

Authentication is success but when getting data via google sdk the error throws 'not connected to healthconnect' but scopes have all permission what are I allowed. when use http api call to get activity data the data shows empty but fit app have data . so give a example or video of integrate to get data from google


DisastrousLark3 months ago

Google data received once added any health data but it literally take 1hr to 2hr to log in terra how to avoid?


ZealousMackerel3 months ago

Please check , When I permit all permission, I can't get any data in health connect, I must select specific permission which relate to step counts, why???


Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.