Skip to content

Commit

Permalink
Merge bd027d8 into f9d2b59
Browse files Browse the repository at this point in the history
  • Loading branch information
antonis authored Nov 28, 2024
2 parents f9d2b59 + bd027d8 commit 8ac9557
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
email: "[email protected]",
message: "Hello World!",
associatedEventId: eventId, // optional
}, {
captureContext: {
tags: { "tag-key": "tag-value" },
},
attachments: [
{
filename: "screenshot.png",
data: "base64-encoded-image",
},
],
});
```

Expand Down
30 changes: 30 additions & 0 deletions samples/react-native-macos/src/components/UserFeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,36 @@ export function UserFeedbackModal(props: { onDismiss: () => void }) {
}}
/>
<View style={styles.buttonSpacer} />
<Button
title="Send feedback with attachment and tags"
color="#6C5FC7"
onPress={async () => {
onDismiss();

const base64Image =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgUBA+kZYq8AAAAASUVORK5CYII=';

const userFeedback: SendFeedbackParams = {
message: comments,
name: 'John Doe',
email: '[email protected]',
};

Sentry.captureFeedback(userFeedback, {
captureContext: {
tags: { testtag: 'testvalue' },
},
attachments: [
{
filename: 'screenshot.png',
data: base64Image,
},
],
});
clearComments();
}}
/>
<View style={styles.buttonSpacer} />
<Button
title="Close"
color="#6C5FC7"
Expand Down
29 changes: 29 additions & 0 deletions samples/react-native/src/components/UserFeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,35 @@ export function UserFeedbackModal(props: { onDismiss: () => void }) {
}}
/>
<View style={styles.buttonSpacer} />
<Button
title="Send feedback with attachment and tags"
color="#6C5FC7"
onPress={async () => {
onDismiss();

const base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgUBA+kZYq8AAAAASUVORK5CYII=';

const userFeedback: SendFeedbackParams = {
message: comments,
name: 'John Doe',
email: '[email protected]',
};

Sentry.captureFeedback(userFeedback, {
captureContext: {
tags: { testtag: 'testvalue' },
},
attachments: [
{
filename: 'screenshot.png',
data: base64Image,
},
],
});
clearComments();
}}
/>
<View style={styles.buttonSpacer} />
<Button
title="Close"
color="#6C5FC7"
Expand Down

0 comments on commit 8ac9557

Please sign in to comment.