-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
165b797
commit 607e04d
Showing
6 changed files
with
24 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<lint> | ||
<issue id="UnusedResources"> | ||
<ignore regexp="`R\.string\.project_id` appears to be unused" /> | ||
<ignore regexp="`R\.string\.com_crashlytics_android_build_id` appears to be unused" /> | ||
</issue> | ||
</lint> |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
-dontwarn javax.annotation.processing.* | ||
-keep class org.acra.** { *; } |
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
22 changes: 5 additions & 17 deletions
22
app/src/play/kotlin/org/sirekanyan/outline/CrashReporter.kt
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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
package org.sirekanyan.outline | ||
|
||
import org.acra.ACRA | ||
import org.acra.config.CoreConfigurationBuilder | ||
import org.acra.config.HttpSenderConfigurationBuilder | ||
import org.acra.sender.HttpSender | ||
import com.google.firebase.Firebase | ||
import com.google.firebase.crashlytics.crashlytics | ||
import com.google.firebase.initialize | ||
|
||
object CrashReporter { | ||
|
||
fun init(app: App) { | ||
val httpSenderConfig = HttpSenderConfigurationBuilder() | ||
.withUri(BuildConfig.ACRA_URI) | ||
.withHttpMethod(HttpSender.Method.POST) | ||
.withBasicAuthLogin(BuildConfig.ACRA_LOGIN) | ||
.withBasicAuthPassword(BuildConfig.ACRA_PASSWORD) | ||
.withEnabled(true) | ||
.build() | ||
val config = CoreConfigurationBuilder() | ||
.withBuildConfigClass(BuildConfig::class.java) | ||
.withPluginConfigurations(httpSenderConfig) | ||
.build() | ||
ACRA.init(app, config) | ||
Firebase.initialize(app) | ||
} | ||
|
||
fun handleException(throwable: Throwable) { | ||
ACRA.errorReporter.handleException(throwable) | ||
Firebase.crashlytics.recordException(throwable) | ||
} | ||
|
||
} |