Skip to content

Commit 8ac9557

Browse files
authored
Merge bd027d8 into f9d2b59
2 parents f9d2b59 + bd027d8 commit 8ac9557

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
2424
message: "Hello World!",
2525
associatedEventId: eventId, // optional
26+
}, {
27+
captureContext: {
28+
tags: { "tag-key": "tag-value" },
29+
},
30+
attachments: [
31+
{
32+
filename: "screenshot.png",
33+
data: "base64-encoded-image",
34+
},
35+
],
2636
});
2737
```
2838

samples/react-native-macos/src/components/UserFeedbackModal.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,36 @@ export function UserFeedbackModal(props: { onDismiss: () => void }) {
6565
}}
6666
/>
6767
<View style={styles.buttonSpacer} />
68+
<Button
69+
title="Send feedback with attachment and tags"
70+
color="#6C5FC7"
71+
onPress={async () => {
72+
onDismiss();
73+
74+
const base64Image =
75+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgUBA+kZYq8AAAAASUVORK5CYII=';
76+
77+
const userFeedback: SendFeedbackParams = {
78+
message: comments,
79+
name: 'John Doe',
80+
81+
};
82+
83+
Sentry.captureFeedback(userFeedback, {
84+
captureContext: {
85+
tags: { testtag: 'testvalue' },
86+
},
87+
attachments: [
88+
{
89+
filename: 'screenshot.png',
90+
data: base64Image,
91+
},
92+
],
93+
});
94+
clearComments();
95+
}}
96+
/>
97+
<View style={styles.buttonSpacer} />
6898
<Button
6999
title="Close"
70100
color="#6C5FC7"

samples/react-native/src/components/UserFeedbackModal.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,35 @@ export function UserFeedbackModal(props: { onDismiss: () => void }) {
6565
}}
6666
/>
6767
<View style={styles.buttonSpacer} />
68+
<Button
69+
title="Send feedback with attachment and tags"
70+
color="#6C5FC7"
71+
onPress={async () => {
72+
onDismiss();
73+
74+
const base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgUBA+kZYq8AAAAASUVORK5CYII=';
75+
76+
const userFeedback: SendFeedbackParams = {
77+
message: comments,
78+
name: 'John Doe',
79+
80+
};
81+
82+
Sentry.captureFeedback(userFeedback, {
83+
captureContext: {
84+
tags: { testtag: 'testvalue' },
85+
},
86+
attachments: [
87+
{
88+
filename: 'screenshot.png',
89+
data: base64Image,
90+
},
91+
],
92+
});
93+
clearComments();
94+
}}
95+
/>
96+
<View style={styles.buttonSpacer} />
6897
<Button
6998
title="Close"
7099
color="#6C5FC7"

0 commit comments

Comments
 (0)