File tree Expand file tree Collapse file tree
packages/core/src/js/tracing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
1212 spanToJSON ,
1313 startIdleSpan as coreStartIdleSpan ,
1414} from '@sentry/core' ;
15- import { AppState } from 'react-native' ;
15+ import { AppState , Platform } from 'react-native' ;
1616import { isRootSpan } from '../utils/span' ;
1717import { adjustTransactionDuration , cancelInBackground } from './onSpanEndUtils' ;
1818import {
@@ -118,8 +118,10 @@ export const startIdleSpan = (
118118 }
119119
120120 const currentAppState = AppState . currentState ;
121- if ( currentAppState === 'background' || currentAppState === 'inactive' ) {
122- debug . log ( `[startIdleSpan] App is already in '${ currentAppState } ' state, not starting span for ${ startSpanOption . name } ` ) ;
121+ if ( currentAppState === 'background' || ( Platform . OS === 'ios' && currentAppState === 'inactive' ) ) {
122+ debug . log (
123+ `[startIdleSpan] App is already in '${ currentAppState } ' state, not starting span for ${ startSpanOption . name } ` ,
124+ ) ;
123125 return new SentryNonRecordingSpan ( ) ;
124126 }
125127
You can’t perform that action at this time.
0 commit comments