Closed reneumeh closed 6 months ago
First of all, thank you for reporting your first issue. Based on your issue description, it sounds like you want to use this library for your Expo application, but it's my understanding that this library is implemented in Turbomodule, one of React Native's newer architectures, so it's not available in Expo Go. We've set up an error message to inform you of this, but it doesn't seem to have gotten through to you. There is a library in the expo faction called expo-sensors that should be able to fully implement the functionality you're looking to implement in this library. I'll close this issue with a simple example.
import React, { useState, useEffect } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Pedometer } from 'expo-sensors';
export default function App() {
const [currentStepCount, setCurrentStepCount] = useState(0);
useEffect(() => {
const subscription = Pedometer.watchStepCount(result => {
setCurrentStepCount(result.steps);
});
return () => subscription.remove();
}, []);
return (
<View style={styles.container}>
<Text>Steps taken: {currentStepCount}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#fff',
},
});
@AndrewDongminYoo Im having the same Problem using RN v74.3 without Expo. (NOBRIDGE) ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'StepCounter' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: true. TurboModule interop: true Any idea on how to fix this?
React Native Step Counter New Issue
Operating System: Windows
Using: Expo@49.0.23 react-native@0.72.10
System: OS: Windows 11 10.0.22631 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Memory: 2.03 GB / 15.86 GB Binaries: Node: version: 18.12.0 path: C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: version: 8.19.2 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio:
Expected Behavior
Actual Behavior
AppRegistry.registerComponent
wasn't called., js engine: hermesSteps to Reproduce the Problem
npm install expo-cli --global npx create-expo-app . --template blank-typescript@sdk-49 npm install expo-sensors@12.3.0 npm install --global @expo/ngrok@^4.1.0
npx expo install react-dom react-native-web @expo/metro-runtime
npx expo install @expo/webpack-config@^18.0.1
npm install @dongminyu/react-native-step-counter npm start -- --tunnel
OR
npm install @dongminyu/react-native-step-counter
npm start -- --tunnel