Skip to content

Commit

Permalink
Update initialization-strategies.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderwee authored Aug 8, 2023
1 parent 98ca068 commit c7483da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/platforms/kotlin-multiplatform/initialization-strategies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ import io.sentry.kotlin.multiplatform.Sentry

// Application context is only needed for Android targets
fun initializeSentry(context: Context?) {
val configuration: (SentryOptions) -> Unit = {
it.dsn = "___PUBLIC_DSN___"
// Add common configuration here
}
if (context != null) {
Sentry.init(context) {
it.dsn = "___PUBLIC_DSN___"
// Add common configuration here
}
Sentry.init(context, configuration)
} else {
Sentry.init(configuration)
}
}
```
Expand Down

0 comments on commit c7483da

Please sign in to comment.