GoogleFit ReactNative Guide
GoogleFit ReactNative Guide
This guide walks you through how to fetch smartwatch health data from Google Fit in a React Native
---
Option 1: Eject
---
$ npx pod-install
---
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
---
-keypass android
---
const options = {
scopes: [
Scopes.FITNESS_ACTIVITY_READ,
Scopes.FITNESS_ACTIVITY_WRITE,
Scopes.FITNESS_HEART_RATE_READ,
],
};
GoogleFit.authorize(options).then(authResult => {
if (authResult.success) {
Date().toISOString()})
Date().toISOString()})
} else {
});
---
$ expo run:android
Make sure the device has Google Fit app and permission to sync data from smartwatch.
---
Optional Enhancements:
- Charts: react-native-chart-kit