getsentry/sentry-cocoa

Capture Screenshot and ViewHierarchy for single events

philipphofmann opened this issue · 4 comments

Description

We could add an API similar to the following:

Attachment.captureScreenshot()
Attachment.captureViewHierarchy()

Then users could use the local scope to capture screenshots and view hierarchy for single events like this

SentrySDK.captureMessage(message: "my message", block: { scope in
	scope.addAttachment(Attachment.captureScreenshot())
})

Consider creating issues for all mobile platforms to have a consistent API.

Also, update the docs:

  1. https://docs.sentry.io/platforms/apple/enriching-events/attachments/
  2. https://docs.sentry.io/platforms/apple/guides/ios/enriching-events/screenshots/https://docs.sentry.io/platforms/apple/guides/ios/enriching-events/viewhierarchy/

Please upvote if you want this feature.

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

This feature is still important to me, and I understand that it seems like there are already other implementations for other platforms, but only iOS doesn't have it yet? If so that's pretty bad, looking forward to seeing it on iOS soon.

kahest commented

Hi @rakuyoMo - this specific feature is generally not available yet. We use this issue to track demand and might bump priority if it receives more upvotes.

On other platforms, Hints can be used to conditionally send Screenshots and/or View Hierarchies by filtering based on Hints in beforeSend. We have an issue open for implementing Hints on sentry-cocoa: #2325

Related issue to add a beforeCapture callback: #3137