-
-
Notifications
You must be signed in to change notification settings - Fork 51
Add attachments support for user feedback #1121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
038936f
Add feedback attachment interface and native impl
tustanivsky d50a373
Update package snapshot
tustanivsky d609856
Fix missing include
tustanivsky 1805c63
Add feedback capture with attachments to sample
tustanivsky 5c5f867
Format code
getsentry-bot f0fbcce
Remove redundant header
tustanivsky 60f9ee8
Add feedback attachments for Mac
tustanivsky f1f89a6
Add feedback attachments for Android
tustanivsky d602645
Format code
getsentry-bot a92adbc
Merge branch 'main' into feat/feedback-attachments
tustanivsky 4caf686
Merge branch 'main' into feat/feedback-attachments
tustanivsky b3263e9
Update changelog
tustanivsky 8eb481a
Update native feedback api on Mac
tustanivsky 0d5b8fd
Merge branch 'main' into feat/feedback-attachments
tustanivsky fbe1eb2
Update snapshot
tustanivsky 1dee8a5
Update native api usage
tustanivsky 6610b9c
Update demo
tustanivsky 8efd1dc
Fix Microsoft feedback instantiation
tustanivsky bf9b4cf
Add null check
tustanivsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
plugin-dev/Source/Sentry/Private/Microsoft/MicrosoftSentryFeedback.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Copyright (c) 2025 Sentry. All Rights Reserved. | ||
|
|
||
| #include "MicrosoftSentryFeedback.h" | ||
|
|
||
| #include "GenericPlatform/GenericPlatformSentryAttachment.h" | ||
|
|
||
| #if USE_SENTRY_NATIVE | ||
|
|
||
| FMicrosoftSentryFeedback::FMicrosoftSentryFeedback() | ||
| : FGenericPlatformSentryFeedback() | ||
| { | ||
| } | ||
|
|
||
| FMicrosoftSentryFeedback::FMicrosoftSentryFeedback(const FString& message) | ||
| : FGenericPlatformSentryFeedback(message) | ||
| { | ||
| } | ||
|
|
||
| void FMicrosoftSentryFeedback::AddFileAttachment(TSharedPtr<FGenericPlatformSentryAttachment> attachment) | ||
| { | ||
| sentry_attachment_t* nativeAttachment = | ||
| sentry_hint_attach_filew(Hint, *attachment->GetPath()); | ||
|
|
||
| if (!attachment->GetFilename().IsEmpty()) | ||
| sentry_attachment_set_filenamew(nativeAttachment, *attachment->GetFilename()); | ||
|
|
||
| if (!attachment->GetContentType().IsEmpty()) | ||
| sentry_attachment_set_content_type(nativeAttachment, TCHAR_TO_UTF8(*attachment->GetContentType())); | ||
|
|
||
| attachment->SetNativeObject(nativeAttachment); | ||
| } | ||
|
|
||
| void FMicrosoftSentryFeedback::AddByteAttachment(TSharedPtr<FGenericPlatformSentryAttachment> attachment) | ||
| { | ||
| const TArray<uint8>& byteBuf = attachment->GetDataByRef(); | ||
|
|
||
| sentry_attachment_t* nativeAttachment = | ||
| sentry_hint_attach_bytesw(Hint, reinterpret_cast<const char*>(byteBuf.GetData()), byteBuf.Num(), *attachment->GetFilename()); | ||
|
|
||
| if (!attachment->GetContentType().IsEmpty()) | ||
| sentry_attachment_set_content_type(nativeAttachment, TCHAR_TO_UTF8(*attachment->GetContentType())); | ||
|
|
||
| attachment->SetNativeObject(nativeAttachment); | ||
| } | ||
|
|
||
| #endif |
23 changes: 23 additions & 0 deletions
23
plugin-dev/Source/Sentry/Private/Microsoft/MicrosoftSentryFeedback.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright (c) 2025 Sentry. All Rights Reserved. | ||
|
|
||
| #pragma once | ||
|
|
||
| #if USE_SENTRY_NATIVE | ||
|
|
||
| #include "GenericPlatform/GenericPlatformSentryFeedback.h" | ||
|
|
||
| class FMicrosoftSentryFeedback : public FGenericPlatformSentryFeedback | ||
| { | ||
| public: | ||
| FMicrosoftSentryFeedback(); | ||
| FMicrosoftSentryFeedback(const FString& message); | ||
| virtual ~FMicrosoftSentryFeedback() override = default; | ||
|
|
||
| protected: | ||
| virtual void AddFileAttachment(TSharedPtr<FGenericPlatformSentryAttachment> attachment) override; | ||
| virtual void AddByteAttachment(TSharedPtr<FGenericPlatformSentryAttachment> attachment) override; | ||
| }; | ||
|
|
||
| typedef FMicrosoftSentryFeedback FPlatformSentryFeedback; | ||
|
|
||
| #endif | ||
|
cursor[bot] marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.