Skip to content

Commit

Permalink
Merge pull request #89 from infinum/documentation/add-info-for-app-st…
Browse files Browse the repository at this point in the history
…artup-lib

Improve Readme with Sentinel initialization info for App Startup lib
  • Loading branch information
KCeh authored Dec 9, 2024
2 parents 605b584 + 224aa85 commit 7d1a811
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,33 @@ Sentinel.watch(

A set of tools should be provided as a _watch_ parameter. This set of tools can be empty.

### App Startup

Under the hood Sentinel is using [App Startup library](https://developer.android.com/topic/libraries/app-startup) to initialize itself.
If you are using [App Startup library](https://developer.android.com/topic/libraries/app-startup) in your project, you might encounter errors related to Sentinel's initialization.

To avoid errors simply add dependency to Sentinel's initializer in your initializer:

```kotlin
class SentinelInitializer : Initializer<Unit> {

override fun create(context: Context) {
Sentinel.watch(
setOf(
ChuckerTool(),
DbInspectorTool(),
GooglePlayTool(),
TimberTool(),
),
)
}

override fun dependencies(): List<Class<out Initializer<*>?>?> = listOf(
com.infinum.sentinel.SentinelInitializer::class.java,
)
}
```

### Tools

_Sentinel_ provides several different levels of tools for a developer to implement.
Expand Down

0 comments on commit 7d1a811

Please sign in to comment.