@@ -15,7 +15,7 @@ import {
15
15
View
16
16
} from 'react-native' ;
17
17
18
- import { isWeb , notWeb } from '../utils/environment' ;
18
+ import { isExpoGo , isWeb , notWeb } from '../utils/environment' ;
19
19
import type { Screenshot } from '../wrapper' ;
20
20
import { getDataFromUri , NATIVE } from '../wrapper' ;
21
21
import { sentryLogo } from './branding' ;
@@ -181,9 +181,11 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
181
181
if ( data != null ) {
182
182
this . setState ( { filename, attachment : data , attachmentUri : imageUri } ) ;
183
183
} else {
184
+ this . _showImageRetrievalDevelopmentNote ( ) ;
184
185
logger . error ( 'Failed to read image data from uri:' , imageUri ) ;
185
186
}
186
187
} ) . catch ( ( error ) => {
188
+ this . _showImageRetrievalDevelopmentNote ( ) ;
187
189
logger . error ( 'Failed to read image data from uri:' , imageUri , 'error: ' , error ) ;
188
190
} ) ;
189
191
}
@@ -196,10 +198,11 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
196
198
if ( data != null ) {
197
199
this . setState ( { filename : 'feedback_screenshot' , attachment : data , attachmentUri : uri } ) ;
198
200
} else {
201
+ this . _showImageRetrievalDevelopmentNote ( ) ;
199
202
logger . error ( 'Failed to read image data from uri:' , uri ) ;
200
203
}
201
- } )
202
- . catch ( ( error ) => {
204
+ } ) . catch ( ( error ) => {
205
+ this . _showImageRetrievalDevelopmentNote ( ) ;
203
206
logger . error ( 'Failed to read image data from uri:' , uri , 'error: ' , error ) ;
204
207
} ) ;
205
208
} ) ;
@@ -402,4 +405,13 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
402
405
private _hasScreenshot = ( ) : boolean => {
403
406
return this . state . filename !== undefined && this . state . attachment !== undefined && this . state . attachmentUri !== undefined ;
404
407
}
408
+
409
+ private _showImageRetrievalDevelopmentNote = ( ) : void => {
410
+ if ( isExpoGo ( ) ) {
411
+ feedbackAlertDialog (
412
+ 'Development note' ,
413
+ 'The feedback widget cannot retrieve image data in Expo Go. Please build your app to test this functionality.' ,
414
+ ) ;
415
+ }
416
+ }
405
417
}
0 commit comments