-
Notifications
You must be signed in to change notification settings - Fork 45
[CLNP-7546] feat: add react-native-nitro-sound for React Native 0.81 support #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
==========================================
- Coverage 11.22% 11.09% -0.13%
==========================================
Files 360 360
Lines 8716 8818 +102
Branches 2479 2480 +1
==========================================
Hits 978 978
- Misses 7662 7764 +102
Partials 76 76 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for React Native 0.81 by introducing react-native-nitro-sound as an alternative to react-native-audio-recorder-player for voice message functionality. It implements adapter classes to handle differences between the two audio modules while maintaining backward compatibility.
Key changes include:
- Added React Native 0.81 support with
react-native-nitro-soundintegration - Implemented adapter pattern for both recorder and player services to handle different module interfaces
- Fixed concurrency issues with recording operations to prevent duplicate stop calls
- Updated iOS minimum version requirement to 15.1
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
sample/ios/SendbirdUIKitSample.xcodeproj/project.pbxproj |
Updated Xcode project configuration and linker flags for new dependencies |
sample/ios/Podfile |
Increased minimum iOS version from 14 to 15.1 for nitro-sound compatibility |
packages/uikit-react-native/src/platform/createRecorderService.native.tsx |
Refactored to use adapter pattern supporting both audio modules with concurrency safety |
packages/uikit-react-native/src/platform/createPlayerService.native.tsx |
Implemented adapter pattern for player service to support both audio modules |
packages/uikit-react-native/src/platform/createFileService.native.ts |
Fixed iOS file path handling for voice message files |
packages/uikit-react-native/src/hooks/useVoiceMessageInput.ts |
Added proper stop handling when sending voice messages during recording |
packages/uikit-react-native/src/components/ChannelInput/VoiceMessageInput.tsx |
Enhanced error logging with additional error details |
packages/uikit-react-native/package.json |
Added nitro-sound dependencies and marked audio modules as optional |
packages/uikit-react-native/README.md |
Updated documentation to reference nitro-sound instead of audio-recorder-player |
docs-validation/package.json |
Updated validation dependencies to include nitro-sound |
docs-validation/1_introduction/SendYourFirstMessage.tsx |
Updated example imports to use nitro-sound |
docs-validation/1_introduction/NativeModules.tsx |
Updated example imports to use nitro-sound |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/uikit-react-native/src/platform/createRecorderService.native.tsx
Show resolved
Hide resolved
|
Q. react-native-audio-recorder-player 는 v3 로 유지하는건가요? |
packages/uikit-react-native/src/platform/createPlayerService.native.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 고생하셨습니다.
0ddf3c8 to
7dcf0cc
Compare
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
[CLNP-7546](https://sendbird.atlassian.net/browse/CLNP-7546)
Description Of Changes
React Native 0.81 지원을 위해 react-native-nitro-sound 사용 가능하도록 추가하였습니다
인터페이스나, 타입등이 다른것들이 많아서, 패키지별 Adapter 클래스를 별도로 추가하여 모둘에 특화된 처리를 분기하였고, 그외에는 공통으로 사용가능하도록 처리하였습니다.
레코딩중 stop 처리후 바로 send를 할경우 send 내부에서 처리되는 clear -> reset -> stop 로 인해 stopRecorder 가 중복으로 호출될경우 exception 이 발생하는 문제가 있습니다. 기존 react-native-audio-recorder-player 에서는 중복 호출되어도 문제가 없었던것 같은데 react-native-nitro-sound 에서는 exception이 발생하여 관련 처리 추가하였습니다.
ui 상 레코딩중 바로 send 처리가 가능한데, 기존에는 문제가 없었지만 react-native-nitro-sound 에서는 stopRecorder 가 완전히 처리 되지 않은 상황에서는 파일을 제대로 읽지 못하는 문제가 발생하여 관련 처리 추가하였습니다.
Types Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_