Coder Social home page Coder Social logo

impetus's Introduction

Impetus

The purpose of this example app is to research how hard it would be to implement Health Data functionality in an Expo managed workflow.

Challenge

Most health data connections are not supported by Expo (exception: Expo Pedometer allows fetching step count data). To access other data in a React Native project, one would usually implement third party libraries, for example react-native-health and react-native-google-fit. These libraries however depend on native code/configuration changes and SDKs, which is historically not supported in an Expo managed workflow.

Solution Directions

Eject

Usually, when a project requires native dependencies outside of the Expo ecosystem, the app needs to be "ejected" from Expo. This will basically transform the project from an Expo project to a core React Native project that has Expo and its libraries as dependencies. The ejection takes some time and effort, but the biggest downside is that the project no longer seamlessly integrates with Expo tooling, such as the Expo Go preview app and EAS build tools. Cost of maintenance will increase, because we will to manage the React Native app as a whole, instead of depending on the Expo conventions and updates.

This is not really a solution because it drops the requirement of remaining (as much as possible) within an Expo managed worklflow.

Development Builds

Expo recently introduced Development Builds. In short, this adds support for generating your own base app to replace the Expo Go preview app. You can use this base app to preview the app on a real device or simulator during development, allow stake-holders to preview updates to the JS bundle or deploy updates to the appstores. Because it replaces (and extends) the Expo core app, you can add native dependencies that are not available within the Expo core.

In our case, we could simply add the mentioned health data dependencies, create a custom development build and deploy to the app stores with EAS build & submit. The caveat: both libraries depend on native configuration changes. To add those without ejecting, we can use Expo Plugins. react-native-health even comes with such a plugin included.

iOS: Health Kit

Adding Health Kit support is very straightforward. Following the additional installation instructions from react-native-health the Health Kit connection is implemented straightforward and the app can be deployed using EAS as is, as can be seen in this repository.

Android: Google Fit / Health Connect

Adding Google Fit brings a lot more complexity. The setup is already complicated on a bare React Native app, and all of those steps would need to be indirectly applied to the native configuration of the Expo project via plugins (and possibly modules).

More importantly, Google has recently announced that Google Fit is now deprecated and will not be supported after 2024. Instead, they bring a new service to the table called Health Connect. This successor app should also allow access to Google Fit data and developers are advised to migrate their apps to Health Connect when possible.

Since Health Connect is only a few months old (and technically still in beta) no React Native libraries have been published to implement it. Until it is, the android side of this experiment will be put on hold.

impetus's People

Contributors

isilher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.