Skip to content

Conversation

@devin-ai-integration
Copy link

Summary

Fixes the BatchedBridge.registerCallableModule is not a function error that occurs on React Native 0.79+ when the New Architecture (Bridgeless mode) is enabled by default.

The fix replaces the old BatchedBridge.registerCallableModule API with the new registerCallableModule API from react-native/Libraries/Core/registerCallableModule.js. This new API internally detects whether Bridgeless mode is active and uses the appropriate registration method, making it compatible with both the old bridge and the New Architecture.

Review & Testing Checklist for Human

  • Test on physical Android device with React Native 0.79+ / Expo SDK 53 - verify the app launches without the BatchedBridge error
  • Verify call detection functionality - ensure the library still correctly detects incoming/outgoing calls and reports state changes
  • Verify backward compatibility - if this fork is used by other projects on older React Native versions, confirm it still works (the new API should handle both cases)

Test Plan

  1. In a React Native 0.79+ / Expo SDK 53 project, update the dependency to point to this branch
  2. Run yarn install and yarn prebuild:clean
  3. Build and run on a physical Android device
  4. Verify app launches without errors
  5. Test call detection by making/receiving a phone call while the app is running

Notes

This change is required for the mobile-app Expo SDK 53 upgrade (CP-3384). The New Architecture is enabled by default in Expo SDK 53, and the old BatchedBridge.registerCallableModule method doesn't exist in Bridgeless mode.

Link to Devin run: https://app.devin.ai/sessions/466ac199cd7342529b5e1dd390b072d2
Requested by: @brooklynrauckman

…ecture compatibility

Replace BatchedBridge.registerCallableModule with the new registerCallableModule API
from react-native/Libraries/Core/registerCallableModule.js. This fixes the
'BatchedBridge.registerCallableModule is not a function' error that occurs on
React Native 0.79+ when the New Architecture (Bridgeless mode) is enabled.

The new API works with both the old bridge and the New Architecture.

Co-Authored-By: brooklyn@carepilot.com <brooklyn@carepilot.com>
@devin-ai-integration
Copy link
Author

Original prompt from brooklyn
https://github.com/DocuCare/mobile-app/pull/1522
look at the comments on this pr and lets pick up where we left off on troubleshooting

@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…TATE permission

- Use AudioManager.OnAudioFocusChangeListener instead of PhoneStateListener
- Remove READ_PHONE_STATE and READ_CALL_LOG permissions from AndroidManifest.xml
- Remove permission requests from Expo config plugin
- This avoids TelephonyPermissions crashes on Android 10+ where READ_PHONE_STATE
  requires runtime permission that may not be granted

The AudioManager approach detects audio focus changes (like when a phone call
takes audio focus) without requiring sensitive phone state permissions.

Co-Authored-By: brooklyn@carepilot.com <brooklyn@carepilot.com>
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.

3 participants