Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Telemetry
Wrapper for Sentry to use in /e/ OS default applications.
## Usage
- First, we need to add dependency repository to `settings.gradle`:
```groovy
maven("https://gitlab.e.foundation/api/v4/groups/1391/-/packages/maven")
```
- Then, we need to add dependency to `build.gradle`:
```groovy
implementation 'foundation.e.lib:telemetry:0.0.6-alpha'
```
- Get the Sentry DSN from the sentry dashboard and add the following to `build.gradle`:
```groovy
buildTypes {
configureEach {
buildConfigField("String", "SENTRY_DSN", "\"${System.getenv("SENTRY_DSN")}\"")
}
}
```
- To use the library, we need to add the following code to the main `Application` class:
```kotlin
Telemetry.init(BuildConfig.SENTRY_DSN, this)
```
- To send an event, we need to add the following code:
```kotlin
Telemetry.reportMessage("sample message")
```
- To get sentry user id, we need to add the following code:
```kotlin
Telemetry.getSentryUserId()
```
# How to force telemetry to be enabled without manual action in settings?
Use adb command:
`adb shell settings put system e_telemetry 1`
# How to get/change sentry user id?
Use adb command:
`adb shell settings get secure sentry_userid`
`adb shell settings put secure sentry_userid 2163681a-0980-41f6-8044-7db50c580986`