File tree 1 file changed +24
-5
lines changed
platform-includes/user-feedback/sdk-api-example
1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 1
1
``` typescript
2
2
import * as Sentry from " @sentry/react-native" ;
3
- import { UserFeedback } from " @sentry/react-native" ;
3
+ import { SendFeedbackParams } from " @sentry/react-native" ;
4
4
5
5
const sentryId = Sentry .captureMessage (" My Message" );
6
6
// OR: const sentryId = Sentry.lastEventId();
7
7
8
- const userFeedback: UserFeedback = {
9
- event_id: sentryId ,
8
+ const userFeedback: SendFeedbackParams = {
10
9
name: " John Doe" ,
11
10
12
- comments: " Hello World!" ,
11
+ message: " Hello World!" ,
12
+ associatedEventId: eventId , // Optional
13
13
};
14
14
15
- Sentry .captureUserFeedback (userFeedback );
15
+ Sentry .captureFeedback (userFeedback );
16
16
```
17
+
18
+ You can also attach further data to the feedback event by passing a hint as a second argument. This is similar to other ` capture ` methods:
19
+
20
+ ``` javascript
21
+ Sentry .captureFeedback (
22
+ { message: " I really like your App, thanks!" },
23
+ {
24
+ captureContext: {
25
+ tags: { key: " value" },
26
+ },
27
+ attachments: [
28
+ {
29
+ filename: ' hello.txt' ,
30
+ data: ' Hello, World!' ,
31
+ },
32
+ ],
33
+ }
34
+ );
35
+ ```
You can’t perform that action at this time.
0 commit comments