An NPM package providing native device rotation sensor data for your expo React Native application.
Important
This NPM package is hosted in the @the-curve-consulting GitHub registry.
To install or contribute to this package, you must have a GitHub personal access token (classic) linked to an account
with access to The Curve organization. In this documentation we will refer to this as being the YOUR_GH_TOKEN_HERE
.
Steps to get started:
- Create or retrieve your personal access token by following the instructions in the GitHub documentation.
- Save your token securely (if you haven’t already) in a trusted password manager, such as your personal 1Password vault, for future use.
Note: This token can also be used to authenticate with the @the-curve-consulting GitHub NPM registry, allowing you to install any package hosted there, not just this one.
- Add
@the-curve-consulting GitHub NPM registry
to your expo project, by creating / editing your project's.npmrc
file on the root of your project:
# .npmrc
+ @the-curve-consulting:registry=https://npm.pkg.github.com
+ //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
- Add this dependency:
NODE_AUTH_TOKEN=YOUR_GH_TOKEN_HERE npm install @the-curve-consulting/expo-sensor-fusion
Important
Anyone installing dependencies on your project will be required to provide the NODE_AUTH_TOKEN everytime they re-install the dependencies.
- That's it! See
/example/src/
for an example of how to use this package.
- Ensure you're running the correct code version in your current terminal session:
nvm install && nvm use
- Install all node dependencies:
npm install
- To edit the native code, ONLY edit them at
<root>/android
or<root>/ios
:- You can edit the native code using any IDE of your choice and on any machine. However it is recommended to use the default native IDE for each platform:
- Open Xcode to edit the iOS native code by running the following from the root of this repo:
npm run open:xcode
- Open Android Studio to edit the Android native code by running from the root of this repo:
npm run open:androistudio
- Open Xcode to edit the iOS native code by running the following from the root of this repo:
- You can edit the native code using any IDE of your choice and on any machine. However it is recommended to use the default native IDE for each platform:
Important
You must never have to manually edit files within ./example/android
nor ./example/ios
. These are updated / generated automatically
everytime you run npm run ios|android
.
- You can preview the package changes during development by running the sample expo app that is embedded into this project within
/example
:
cd example
# Start an iOS simulator with an example app (expo development client) where this package is installed (requires macOS)
npm run ios
# Start an Android emulator and installs the example app (expo development client) where this package is installed.
npm run android
Note
This package follows semantic versioning with the format: major.minor.patch
.
- Major version: Increment when making incompatible API changes.
- Minor version: Increment when adding new functionality in a backward-compatible way.
- Patch version: Increment when fixing bugs in a backward-compatible manner.
- Push your changes to the
main
branch. - Navigate to Create a New Release
- Create a new tag using the semantic versioning format, prefixed with
v
(e.g.,E.g.: v2.3.0
). - Use the same name as the tag for the release title.
- Click Generate release notes, and/or edit the description to detail the changes.
- Click the green Publish release button.
- A GitHub action will automatically run to publish the new version of the package to the registry.
- Monitor the status at the-curve-consulting/expo-sensor-fusion/actions