Skip to content

erichfw/fitbit-versa4-app

Repository files navigation

MindfulMomements App

This app functions as a mindfulness bell or a coaching session timer on the fitbit versa4. When in mindfulness mode, thhe device vibrates every 15min when the timer (and app) is running. WHen in coaching-session mode, the device vibrates 30min, 45min, after the timer is started. The app also shows the current device time.

Based on

Fitbit does not support 3rd party applications for the fitbit versa 4. This is based on the unofficial approach for building and sideloading a 3rd-party application to Fitbit Versa 4. That provided for educational purposes only. Use at your own risk.

The appraoch is:

  • Enables the hosts command via the FITBIT_QA_COMMANDS environment flag.
  • Uses unofficial drop-in package for @fitbit/sdk-build-targets
  • Sets the enableProposedAPI for installs.

Screenshots

App List App
app list app

Quick Start

To summarise in four steps:

Build the app

cd app && \
npm install && \
npm build

Prepare the bridge

Open Fitbit app, access the Developer Menu, toggle on Developer Bridge and wait for the "Waiting for Studio" status.

On the Versa 4/Sense 2, connect the device to charger, goto Settings and navigate to Developer bridge, toggle USB debugging on.

Enable the FITBIT_QA_COMMANDS environment flag, this allows the device USB host to be discoverable.

./env.ps1

Optionally enable the FITBIT_DEVBRIDGE_DUMP environment flag to capture all developer bridge protocol messages for debugging purposes.

export FITBIT_DEVBRIDGE_DUMP=1

Connect the devices

NOTE: When you first start the debug command, you may be requested to login to your Fitbit developer account.

yarn debug

Once connected and the fitbit$ prompt is ready, type hosts to verify the watch and phone (companion host) can be found.

fitbit$ hosts
Device Hosts:
[
  {
    displayName: 'Hera',
    available: true,
    roles: [ 'APP_HOST' ],
    connect: [AsyncFunction: connect]
  }
]
Phone Hosts:
[
  {
    available: true,
    connect: [Function: connect],
    displayName: 'Samsung SM-G991B',
    roles: [ 'COMPANION_HOST' ]
  }
]

Now, connect! First start with connect phone, followed by connect device.

fitbit$ connect phone
Auto-connecting only known phone: Samsung SM-G991B
fitbit$ connect device
Auto-connecting only known device: Hera

Install the app

fitbit$ build-and-install

> testapp@1.0.0 build
> fitbit-build

[warn][build] Targeting proposed API may cause your app to behave unexpectedly. Use only when needed for development or QA.
[warn][settings] This project is being built without a settings component. Create a file named settings/index.tsx, settings/index.ts, settings/index.jsx or settings/index.js to add a settings component to your project.
[info][app] Building app for Fitbit Versa 4
[info][companion] Building companion
[info][build] App UUID: 2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1, BuildID: 0x09256fc65528043a
No app package specified. Reloading ./build/app.fba.
Loaded appID:2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1 buildID:0x09256fc65528043a
App install complete (full)
Companion install complete (full)
Launching app
Companion: Loaded and evaluated: file:///android_asset/bootstrap.js                                                                                (js-engine-bootstrap.html:9,1)
Companion: Companion code started                                                                                                                        (companion/index.js:5,1)
Companion: Loaded and evaluated: file:///data/user/0/com.fitbit.FitbitMobile/app_companions/2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1/0x09256fc65528043a/companion.js                                                                                                                                                                                 (js-engine-bootstrap.html:9,1)
Companion: Companion launched by [launchedOnTracker]

About

Mindfulness App for fitbit-versa4-app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •