Skip to content

Commit 48a7972

Browse files
committed
Updates onAddScreenshot callback
1 parent 5a51f0c commit 48a7972

File tree

1 file changed

+5
-5
lines changed
  • docs/platforms/react-native/user-feedback/configuration

1 file changed

+5
-5
lines changed

docs/platforms/react-native/user-feedback/configuration/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The following callbacks can be configured for the integration in `feedbackIntegr
133133
| `onSubmitSuccess` | `data: FeedbackFormData` | | Callback when feedback is successfully submitted. |
134134
| `onSubmitError` | `error: Error` | | Callback when feedback is unsuccessfully submitted. |
135135
| `onFormSubmitted` | | The widget is unmounted.| Callback when the feedback widget is submitted successfully, and the SuccessMessage is complete, or dismissed.|
136-
| `onAddScreenshot` | `attachFile: (filename: string, data: Uint8Array) => void` | | Callback when a screenshot is added. |
136+
| `onAddScreenshot` | `addScreenshot: (uri: string) => void` | | Callback when a screenshot is added. |
137137

138138
## Screenshots
139139

@@ -171,20 +171,20 @@ Sentry.init({
171171

172172
### Implementing the `onAddScreenshot` Callback
173173

174-
If the above libraries do not cover your use case you can manually integrate screenshots by implementing the `onAddScreenshot` callback. The callback receives a filename and a `Uint8Array` of the image data like in the example below.
174+
If the above libraries do not cover your use case you can manually integrate screenshots by implementing the `onAddScreenshot` callback. The callback receives the `uri` of the image like in the example below.
175175

176176
```javascript
177177
import * as Sentry from '@sentry/react-native';
178178
import { getImage } from 'custom-image-picker';
179179

180-
const handleChooseImage = (attachFile: (filename: string, data: Uint8Array) => void): void => {
181-
const { filename, bytes, error, canceled } = getImage();
180+
const handleChooseImage = (addScreenshot: (uri: string) => void): void => {
181+
const { uri, error, canceled } = getImage();
182182
if (canceled) {
183183
console.log('User canceled image choice.');
184184
} else if (error) {
185185
console.log('Error during image loading', error);
186186
} else {
187-
attachFile(filename, bytes);
187+
addScreenshot(uri);
188188
}
189189
};
190190

0 commit comments

Comments
 (0)