Conversation
7724a3d to
80b091e
Compare
22b11ab to
4994f68
Compare
There was a problem hiding this comment.
Pull request overview
This PR exposes a new React Native UNSTABLE_onBeforeReportSend callback that fires before an issue report is sent, aligning RN behavior with the native SDKs.
Changes:
- Adds a JS-facing
UNSTABLE_onBeforeReportSendcrash reporting option and wires it to native-emitted events. - Implements native issue report callbacks on iOS/Android and forwards them to JS via event emitters.
- Updates documentation and example apps to demonstrate the new callback.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native/src/index.tsx | Adds new public types/options and registers an event listener to invoke UNSTABLE_onBeforeReportSend. |
| packages/react-native/src/NativeBdReactNative.ts | Extends the TurboModule spec with addListener/removeListeners to support RN event emitter semantics. |
| packages/react-native/ios/Logger.swift | Configures Capture’s issue callback and posts a notification containing report metadata. |
| packages/react-native/ios/BdReactNative.mm | Bridges notifications to JS events via RCTEventEmitter. |
| packages/react-native/ios/BdReactNative.h | Switches module base class to RCTEventEmitter for both old/new architecture. |
| packages/react-native/android/src/main/java/com/bdreactnative/BdReactNativeModule.kt | Configures Capture issue callback and emits issue report events to JS. |
| packages/react-native/README.md | Documents UNSTABLE_onBeforeReportSend and adds usage examples. |
| examples/expo/src/lib/bitdrift.ts | Demonstrates callback usage and logging of report metadata. |
| examples/HermesSample/lib/bitdrift.ts | Demonstrates callback usage and logging of report metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
4994f68 to
edcbea5
Compare
There was a problem hiding this comment.
Pull request overview
Adds a React Native-facing onBeforeReportSend (issue report) callback by bridging native issue report callbacks to JS via an event emitter, bringing parity with native SDK behavior.
Changes:
- Introduces JS types and init-time wiring to subscribe to a native “before report send” event and enable native callback bridging only when needed.
- Implements native-side callback plumbing on iOS (NotificationCenter → RCTEventEmitter) and Android (IssueReportCallback → DeviceEventEmitter), plus required event-emitter contract methods.
- Updates README and sample apps to demonstrate the new callback.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native/src/index.tsx | Adds public callback/types, subscribes to issue-report events, and maps JS options to native options with a bridge enable flag. |
| packages/react-native/src/NativeBdReactNative.ts | Extends TurboModule spec/options to include internal enable flag + event emitter contract methods. |
| packages/react-native/ios/Logger.swift | Wires Capture issue callback to a NotificationCenter notification and threads it via a dedicated queue. |
| packages/react-native/ios/BdReactNative.mm | Converts the notification into an RN event (RCTEventEmitter) and forwards the new enable flag into Logger start. |
| packages/react-native/ios/BdReactNative.h | Makes the module an RCTEventEmitter to support JS event subscriptions. |
| packages/react-native/android/src/main/java/com/bdreactnative/BdReactNativeModule.kt | Adds issue callback configuration and emits issue reports to JS; adds addListener/removeListeners no-ops. |
| packages/react-native/README.md | Documents the new callback option in usage/config sections. |
| examples/expo/src/lib/bitdrift.ts | Demonstrates the callback in the Expo example. |
| examples/HermesSample/lib/bitdrift.ts | Demonstrates the callback in the Hermes sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Fran Aguilera <fran.aguilera12@gmail.com>
6256c16 to
d59f870
Compare
d59f870 to
6934551
Compare
What
Resolves BIT-7610
Brings parity to RN with available callback in the native sdk (see related PR here)
Example below
Verification