Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Make format
run: make format

Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
This project is an experimental SDK for Kotlin Multiplatform.
This SDK is a wrapper around different platforms such as JVM, Android, iOS, macOS, watchOS, tvOS that can be used on Kotlin Multiplatform.

| Packages | Maven Central
|-----------------------------------------| -------
| sentry-kotlin-multiplatform | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform)

## Supported Platforms

| Target Platform | Target preset |
Expand All @@ -24,36 +28,29 @@ This SDK is a wrapper around different platforms such as JVM, Android, iOS, macO

## Configure Repository

The Kotlin Multiplatform SDK is available only on `mavenLocal`. You can declare this repository in your build script as follows:
The Kotlin Multiplatform SDK is available on `mavenCentral`. You can declare this repository in your build script as follows:

```gradle
repositories {
// Currently only supported locally
mavenLocal()
mavenCentral()
}
```

and then run:

```bash
./gradlew publishToMavenLocal
```

## Add dependency
For a multiplatform project, you need to add the sentry-kotlin-multiplatform artifact to the `commonMain` source set:

```Kotlin
val commonMain by getting {
dependencies {
api("io.sentry:sentry-kotlin-multiplatform:0.0.1")
api("io.sentry:sentry-kotlin-multiplatform:<version>")
}
}
```

### Cocoa

If you are targeting Apple platforms (iOS, macOS, watchOS, tvOS), then you need to use CocoaPods to include [Sentry Cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK.
One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension. Be aware that your Sentry Cocoa version has to match the SDK's version. Currently the supported version is `~> 7.21.0`
If you are targeting Apple platforms (iOS, macOS, watchOS, tvOS), then you can use CocoaPods to include [Sentry Cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK.
One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension. Be aware that your Sentry Cocoa version has to match the version used in the KMP SDK.

```gradle
cocoapods {
Expand All @@ -66,7 +63,7 @@ cocoapods {
baseName = "shared"

// Export the SDK in order to be able to access it directly in the iOS project
export("io.sentry:sentry-kotlin-multiplatform:0.0.1")
export("io.sentry:sentry-kotlin-multiplatform:<version>")
}
}
```
Expand All @@ -75,11 +72,11 @@ cocoapods {

There are two main strategies for initializing the SDK:
- Shared initializer
- Platform specific initializers
- Platform-specific initializers

Shared initializer will initialize the SDK in your shared codebase but you will use the same configuration options for all platforms.

Platform specific initializers initialize the SDK directly in the target platform. The benefit is being able to customize the configuration options specific to the platforms.
Platform-specific initializers initialize the SDK directly in the target platform. The benefit is being able to customize the configuration options specific to the platforms.

It is also possible to mix those two strategies based on your needs and project setup.

Expand Down Expand Up @@ -140,7 +137,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
}
```

## Platform Specific Initializers
## Platform-Specific Initializers
### Android

```Kotlin
Expand Down