-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Sentry for crash report (#413)
* Adding Sentry gradle * Update AndroidManifest.xml * Implement and init sentry * Update build.gradle * Update ExceptionManager * Update AndroidManifest.xml
- Loading branch information
1 parent
3591be7
commit 7d179a6
Showing
5 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
|
@@ -129,5 +129,10 @@ | |
android:icon="@drawable/notification_icon" | ||
android:label="@string/Dashboard_Card_Run"> | ||
</service> | ||
|
||
<meta-data | ||
android:name="io.sentry.dsn" | ||
android:value="https://[email protected]/5619989" /> | ||
|
||
</application> | ||
</manifest> |
This file contains 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 |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
import java.util.Date; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import io.sentry.android.core.SentryAndroid; | ||
import okhttp3.Interceptor; | ||
import okhttp3.OkHttpClient; | ||
import okhttp3.Request; | ||
|
@@ -50,6 +51,20 @@ public class Application extends android.app.Application { | |
FlavorApplication.onCreate(this); | ||
if (BuildConfig.DEBUG) | ||
FlowLog.setMinimumLoggingLevel(FlowLog.Level.V); | ||
else { | ||
SentryAndroid.init(this, | ||
options -> { | ||
options.setDsn("https://[email protected]/5619989"); | ||
options.setBeforeSend( | ||
(event, hint) -> { | ||
// Drop an event altogether: | ||
if (!preferenceManager.isSendCrash()) { | ||
return null; | ||
} | ||
return event; | ||
}); | ||
}); | ||
} | ||
if (preferenceManager.canCallDeleteJson()) | ||
Measurement.deleteUploadedJsons(this); | ||
Measurement.deleteOldLogs(this); | ||
|