-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: override native options (#221)
* Add native options * Update * Update * Update * Format * Update * Update * Format code * Update * Update * Update changelog * Format code * update * Update api * Update * Format code * Update * Update * Update comments * Fix detekt * Update * Add review * Update * Fix test * Update samples * Update * Update * Format code * Update --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
- Loading branch information
1 parent
dc19da0
commit 1c5183c
Showing
50 changed files
with
628 additions
and
121 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
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 |
---|---|---|
|
@@ -50,4 +50,4 @@ Pod::Spec.new do |spec| | |
} | ||
] | ||
|
||
end | ||
end |
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
14 changes: 14 additions & 0 deletions
14
...m/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/SentryPlatformInstance.android.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
import io.sentry.android.core.SentryAndroid | ||
|
||
internal actual class SentryPlatformInstance : SentryInstance { | ||
override fun init(configuration: PlatformOptionsConfiguration) { | ||
val context = applicationContext ?: run { | ||
// TODO: add logging later | ||
return | ||
} | ||
|
||
SentryAndroid.init(context, configuration) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...rm/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/SentryPlatformOptions.android.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.sentry.kotlin.multiplatform | ||
|
||
import io.sentry.kotlin.multiplatform.extensions.toAndroidSentryOptionsCallback | ||
|
||
public actual typealias SentryPlatformOptions = io.sentry.android.core.SentryAndroidOptions | ||
|
||
internal actual fun SentryPlatformOptions.prepareForInit() { | ||
sdkVersion?.name = BuildKonfig.SENTRY_KMP_ANDROID_SDK_NAME | ||
sdkVersion?.version = BuildKonfig.VERSION_NAME | ||
if (sdkVersion?.packageSet?.none { it.name == BuildKonfig.SENTRY_ANDROID_PACKAGE_NAME } == true) { | ||
sdkVersion?.addPackage(BuildKonfig.SENTRY_ANDROID_PACKAGE_NAME, BuildKonfig.SENTRY_ANDROID_VERSION) | ||
} | ||
} | ||
|
||
internal actual fun SentryOptions.toPlatformOptionsConfiguration(): PlatformOptionsConfiguration = | ||
toAndroidSentryOptionsCallback() | ||
|
||
internal actual fun SentryPlatformOptions.prepareForInitBridge() { | ||
prepareForInit() | ||
} |
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
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
Oops, something went wrong.