Skip to content

Conversation

@Axster
Copy link

@Axster Axster commented Jul 4, 2025

🔍 Summary

Please provide a concise description of what this PR does and why.

  • What did you change?

  • Updated native iOS module declarations and imports to ensure compatibility with the New Architecture in React Native. Also made minor Android updates for consistency.

  • Why is this change necessary?

  • Without these changes, the library does not work properly under the New Architecture: iOS fails to expose the module methods due to the missing inheritance from RCTEventEmitter.

🛠️ Changes

  • Replaced NSObject with RCTEventEmitter in StepCounter interface (iOS)
  • Updated imports to include <React/RCTEventEmitter.h> for iOS
  • Removed legacy bridge property and unused imports
  • Updated package.json main field from lib/commonjs/index.js to lib/module/index.js
  • Added @ReactModule import in Android module

🔗 Related Issue

this PR does not close any issue

✅ Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (backwards-incompatible)
  • Documentation update
  • Chore / Refactoring

📋 Checklist

  • My code follows the repository’s style guidelines
  • I have added tests covering my changes
  • I have run yarn lint and yarn test locally with no failures
  • I have updated the README or relevant documentation
  • I have provided version and environment details if applicable

🚀 How to Test

  1. git checkout <this-branch>
  2. yarn install && cd example && yarn install
  3. yarn build
  4. yarn test
  5. Example Usage:
    import {
      isSensorWorking,
      isStepCountingSupported,
      parseStepData,
      startStepCounterUpdate,
      stopStepCounterUpdate,
      type ParsedStepCountData,
    } from '@dongminyu/react-native-step-counter';
    // …

📸 Screenshots (if applicable)

If your change adds UI or visual output, include before/after screenshots or GIFs.

@trunk-io
Copy link

trunk-io bot commented Jul 4, 2025

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant