StasDoskalenko / react-native-google-fit

A React Native bridge module for interacting with Google Fit
MIT License
335 stars 209 forks source link

Expo config plugin #312

Open nicobermudez opened 2 years ago

nicobermudez commented 2 years ago

I'd like to be able to use this with Expo's Managed Workflow and EAS. Would it be possible to create a custom Expo plugin similar to React Native Health?

vladpiciorea commented 2 years ago

Hi, I can't get it to work with expo either.

frankcalise commented 2 years ago

Hey! No Expo plugin is needed to get this library to work. You do still have to create a custom dev client, though.

Try out these steps:

  1. expo install expo-dev-client react-native-google-fit
  2. eas build --profile development --platform android - allow it to create an Expo project on your account, this is what you'll need to obtain the SHA1 from the credentials page
  3. After the build finishes, obtain the SHA1 for your Google OAuth Client ID by visiting https://expo.dev/accounts/[account]/projects/[project]/credentials
    • Press the application identifier
    • Grab value from SHA-1 Certificate Fingerprint
    • Paste in Google Console
  4. yarn expo start --dev-client to start metro
  5. Install the dev client on your device
  6. Edit your app to call on the GoogleFit APIs and watch auth success and subsequent calls work!