File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed
platform-includes/user-feedback/sdk-api-example Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 11``` typescript
22import * as Sentry from " @sentry/react-native" ;
3- import { UserFeedback } from " @sentry/react-native" ;
3+ import { SendFeedbackParams } from " @sentry/react-native" ;
44
55const sentryId = Sentry .captureMessage (" My Message" );
66// OR: const sentryId = Sentry.lastEventId();
77
8- const userFeedback: UserFeedback = {
9- event_id: sentryId ,
8+ const userFeedback: SendFeedbackParams = {
109 name: " John Doe" ,
111012- comments: " Hello World!" ,
11+ message: " Hello World!" ,
12+ associatedEventId: eventId , // Optional
1313};
1414
15- Sentry .captureUserFeedback (userFeedback );
15+ Sentry .captureFeedback (userFeedback );
1616```
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