-
-
Notifications
You must be signed in to change notification settings - Fork 354
feat: Screenshots #2610
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
feat: Screenshots #2610
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
799f47c
Add attachScreenshot option
PaitoAnderson c4ef535
Update CHANGELOG.md
PaitoAnderson 2150a89
Update CHANGELOG.md
marandaneto 5c14aae
Merge branch 'main' into feat-screenshots
krystofwoldrich b1f24f4
Add android screenshots
krystofwoldrich c8f8fa3
Add ios screenshots
krystofwoldrich 236af14
Update changelog
krystofwoldrich 56ee9f7
Run view draw on ui thread
krystofwoldrich 94036ac
Return attachScreenshot to android options
krystofwoldrich c16aba5
Return png to android
krystofwoldrich 9b5f50d
Fix envelope item content_type
krystofwoldrich b606e56
Use sentry-cocoa implementation of screenshots
krystofwoldrich be91755
Use screenshots implementation from android sdk and set correct activ…
krystofwoldrich 3f24ae8
Change android implementation to use activity holder and static scree…
krystofwoldrich 6c8c85c
Merge remote-tracking branch 'origin/main' into feat-screenshots
krystofwoldrich 6aaae4d
Add multiple screenshots support
krystofwoldrich a6350df
Fix lint
krystofwoldrich 60bb606
Use promise like and sync promise
krystofwoldrich 1f5c846
Merge branch 'main' into feat-screenshots
krystofwoldrich 6bb2430
Add log if take screenshot fails
krystofwoldrich be6041c
Add screenshot integration
krystofwoldrich 1e368e9
Merge branch 'main' into feat-screenshots
krystofwoldrich 990f9e0
chore: RNSentry call getCurrentActivity directly
krystofwoldrich e9a389d
Merge remote-tracking branch 'origin/main' into feat-screenshots
krystofwoldrich ec6927f
Merge remote-tracking branch 'origin/main' into feat-screenshots
krystofwoldrich 4a46f54
Fix changelog move screenshots to unreleased section
krystofwoldrich efe56ce
Fix fetchModules, use sentry logger
krystofwoldrich 5b1dc60
Merge branch 'main' into feat-screenshots
marandaneto 9757ab5
Merge branch 'main' into feat-screenshots
krystofwoldrich 69b7454
Fix changelog
krystofwoldrich 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,8 @@ Sentry.init({ | |
| // release: '[email protected]+1', | ||
| // dist: `1`, | ||
| attachStacktrace: true, | ||
| // Attach screenshots to events. | ||
| attachScreenshot: true, | ||
| }); | ||
|
|
||
| const Stack = createStackNavigator(); | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { EventHint, Integration } from '@sentry/types'; | ||
| import { resolvedSyncPromise } from '@sentry/utils'; | ||
|
|
||
| import { NATIVE } from '../wrapper'; | ||
|
|
||
| /** Adds screenshots to error events */ | ||
| export class Screenshot implements Integration { | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| public static id: string = 'Screenshot'; | ||
|
|
||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| public name: string = Screenshot.id; | ||
|
|
||
| /** | ||
| * If enabled attaches a screenshot to the event hint. | ||
| */ | ||
| public static attachScreenshotToEventHint( | ||
| hint: EventHint, | ||
| { attachScreenshot }: { attachScreenshot?: boolean }, | ||
| ): PromiseLike<EventHint> { | ||
| if (!attachScreenshot) { | ||
| return resolvedSyncPromise(hint); | ||
| } | ||
|
|
||
| return NATIVE.captureScreenshot() | ||
| .then((screenshots) => { | ||
| if (screenshots !== null && screenshots.length > 0) { | ||
| hint.attachments = [ | ||
| ...screenshots, | ||
| ...(hint?.attachments || []), | ||
| ]; | ||
| } | ||
| return hint; | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| // eslint-disable-next-line @typescript-eslint/no-empty-function | ||
| public setupOnce(): void {} | ||
| } |
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
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.