Skip to content

Commit 559c152

Browse files
authored
chore(feedback): Update the samples with an attachment/tags example (#4322)
1 parent 6c56eb1 commit 559c152

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
2323
message: "Hello World!",
2424
associatedEventId: eventId, // optional
25+
}, {
26+
captureContext: {
27+
tags: { "tag-key": "tag-value" },
28+
},
29+
attachments: [
30+
{
31+
filename: 'hello.txt',
32+
data: 'Hello, World!',
33+
},
34+
],
2535
});
2636
```
2737

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,33 @@ 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 userFeedback: SendFeedbackParams = {
75+
message: comments,
76+
name: 'John Doe',
77+
78+
};
79+
80+
Sentry.captureFeedback(userFeedback, {
81+
captureContext: {
82+
tags: { testtag: 'testvalue' },
83+
},
84+
attachments: [
85+
{
86+
filename: 'hello.txt',
87+
data: 'Hello, World!',
88+
},
89+
],
90+
});
91+
clearComments();
92+
}}
93+
/>
94+
<View style={styles.buttonSpacer} />
6895
<Button
6996
title="Close"
7097
color="#6C5FC7"

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,33 @@ 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 userFeedback: SendFeedbackParams = {
75+
message: comments,
76+
name: 'John Doe',
77+
78+
};
79+
80+
Sentry.captureFeedback(userFeedback, {
81+
captureContext: {
82+
tags: { testtag: 'testvalue' },
83+
},
84+
attachments: [
85+
{
86+
filename: 'hello.txt',
87+
data: 'Hello, World!',
88+
},
89+
],
90+
});
91+
clearComments();
92+
}}
93+
/>
94+
<View style={styles.buttonSpacer} />
6895
<Button
6996
title="Close"
7097
color="#6C5FC7"

0 commit comments

Comments
 (0)