From 6df184e22ec69650294f9f0a9f6609636bd26e21 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 28 Mar 2024 22:53:14 +0200 Subject: [PATCH] feat(native): add user feedback feature description (#9512) * feat(native): add user feedback feature description * Update docs/platforms/native/user-feedback/index.mdx Co-authored-by: Liza Mock * Update docs/platforms/native/user-feedback/index.mdx Co-authored-by: Liza Mock * Update docs/platforms/native/user-feedback/index.mdx Co-authored-by: Liza Mock --------- Co-authored-by: Liza Mock --- docs/platforms/native/user-feedback/index.mdx | 17 +++++++++++++++++ .../user-feedback/sdk-api-example/native.mdx | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 docs/platforms/native/user-feedback/index.mdx create mode 100644 platform-includes/user-feedback/sdk-api-example/native.mdx diff --git a/docs/platforms/native/user-feedback/index.mdx b/docs/platforms/native/user-feedback/index.mdx new file mode 100644 index 0000000000000..91c470050738c --- /dev/null +++ b/docs/platforms/native/user-feedback/index.mdx @@ -0,0 +1,17 @@ +--- +title: Set Up User Feedback +description: "Learn how to view user feedback submissions which, paired with the original event, give you additional insight into issues." +sidebar_order: 6000 +--- + +Sentry makes it possible to collect additional feedback when a user experiences an error. You can collect feedback according to the method supported by your SDK of choice. + +## User Feedback API + +The user feedback API allows you to collect user feedback using your own UI. You can use the same programming language you have in your app to then send the feedback. In this case, the SDK creates the HTTP request so you don't have to deal with posting data via HTTP. + +Sentry pairs the feedback with the original event, giving you additional insight into issues. In order to do this, Sentry needs the `eventId`. For example, to get the `eventId`, you can use or the return value of the method capturing an event. + + + +Alternatively, you can use the [User Feedback API endpoint](/api/projects/submit-user-feedback/) directly. diff --git a/platform-includes/user-feedback/sdk-api-example/native.mdx b/platform-includes/user-feedback/sdk-api-example/native.mdx new file mode 100644 index 0000000000000..e17c9d056fa85 --- /dev/null +++ b/platform-includes/user-feedback/sdk-api-example/native.mdx @@ -0,0 +1,11 @@ +```cpp +#include + +sentry_value_t event = sentry_value_new_message_event( + SENTRY_LEVEL_INFO, "my-logger", "Hello user feedback!"); +sentry_uuid_t event_id = sentry_capture_event(event); + +sentry_value_t user_feedback = sentry_value_new_user_feedback( + &event_id, "Jane", "jane.doe@example.com", "Feedback message"); +sentry_capture_user_feedback(user_feedback); +```