11import type React from 'react' ;
2- import { findNodeHandle , Platform , processColor } from 'react-native' ;
2+ import { Platform , findNodeHandle , processColor } from 'react-native' ;
33
44import type {
55 NavigationContainerRefWithCurrent ,
@@ -10,8 +10,7 @@ import type { NavigationAction, NavigationState as NavigationStateV4 } from 'rea
1010
1111import type { InstabugConfig } from '../models/InstabugConfig' ;
1212import Report from '../models/Report' ;
13- import { emitter , NativeEvents , NativeInstabug } from '../native/NativeInstabug' ;
14- import { registerW3CFlagsListener } from '../utils/FeatureFlags' ;
13+ import { NativeEvents , NativeInstabug , emitter } from '../native/NativeInstabug' ;
1514import {
1615 ColorTheme ,
1716 Locale ,
@@ -68,8 +67,6 @@ export const init = (config: InstabugConfig) => {
6867 InstabugUtils . captureJsErrors ( ) ;
6968 captureUnhandledRejections ( ) ;
7069
71- Platform . OS === 'android' && registerW3CFlagsListener ( ) ;
72-
7370 // Default networkInterceptionMode to JavaScript
7471 if ( config . networkInterceptionMode == null ) {
7572 config . networkInterceptionMode = NetworkInterceptionMode . javascript ;
@@ -547,7 +544,7 @@ export const onStateChange = (state?: NavigationStateV5) => {
547544export const setNavigationListener = (
548545 navigationRef : NavigationContainerRefWithCurrent < ReactNavigation . RootParamList > ,
549546) => {
550- return navigationRef . addListener ( 'state' , ( ) => {
547+ navigationRef . addListener ( 'state' , ( ) => {
551548 onStateChange ( navigationRef . getRootState ( ) ) ;
552549 } ) ;
553550} ;
@@ -643,20 +640,3 @@ export const componentDidAppearListener = (event: ComponentDidAppearEvent) => {
643640 _lastScreen = event . componentName ;
644641 }
645642} ;
646-
647- /**
648- * Sets listener to W3ExternalTraceID flag changes
649- * @param handler A callback that gets the update value of the flag
650- */
651- export const _registerW3CFlagsChangeListener = (
652- handler : ( payload : {
653- isW3ExternalTraceIDEnabled : boolean ;
654- isW3ExternalGeneratedHeaderEnabled : boolean ;
655- isW3CaughtHeaderEnabled : boolean ;
656- } ) => void ,
657- ) => {
658- emitter . addListener ( NativeEvents . ON_W3C_FLAGS_CHANGE , ( payload ) => {
659- handler ( payload ) ;
660- } ) ;
661- NativeInstabug . registerW3CFlagsChangeListener ( ) ;
662- } ;
0 commit comments