getsentry / getsentry/sentry-cocoa
Expose device identifier
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 418
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 106
Description
### Problem Statement
Sentry uses some internal logic to combine device information into a hash called the `deviceAppHash`, exposed as `app.device` in the crash reports.
Unfortunately, there is no way for the developer to access this identifier directly. Effectively, this is a private data point internal to Sentry.
I would like to gain access to this identifier. It is quite useful when we want to direct our developers to the crash logs for a specific user's device.
Naively, I was building this link as such:
```
"See Sentry: https://hubstaff.sentry.io/issues/?query=app.device%3A\(UIDevice.current.identifierForVendor?.uuidString)"
```
But this doesn't work since Sentry hashes the identifier (alongside potentially some other information).
Ideally Sentry shouldn't manage private data on the user which is hidden from the developer.
### Solution Brainstorm
The device identifier is generated in `Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_System.m`, stored in a private `g_systemData`, copied into `eventContext->System.deviceAppHash`, written to the crash report's `device_app_hash` in `Sources/SentryCrash/Recording/SentryCrashReport.c`.
Suggest exposing the identifier in `SentrySDK` or `SentryClient`.
### Are you willing to submit a PR?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.