From 60f65bf520c57ffde6b9b74ff8fa010b483c8f56 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 14:44:01 +0200
Subject: [PATCH 1/6] add HiddenFromObjc
---
.../kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt | 4 ++++
sentry-samples/kmp-app/iosApp/iosApp/iOSApp.swift | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt b/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt
index c796c528..f25c565b 100644
--- a/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt
+++ b/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt
@@ -4,6 +4,8 @@ import io.sentry.kotlin.multiplatform.protocol.Breadcrumb
import io.sentry.kotlin.multiplatform.protocol.SentryId
import io.sentry.kotlin.multiplatform.protocol.User
import io.sentry.kotlin.multiplatform.protocol.UserFeedback
+import kotlin.experimental.ExperimentalObjCRefinement
+import kotlin.native.HiddenFromObjC
typealias ScopeCallback = (Scope) -> Unit
typealias OptionsConfiguration = (SentryOptions) -> Unit
@@ -19,6 +21,8 @@ object Sentry {
* @param context: The context (used for retrieving Android Context)
* @param configuration Options configuration handler.
*/
+ @OptIn(ExperimentalObjCRefinement::class)
+ @HiddenFromObjC
fun init(context: Context, configuration: OptionsConfiguration) {
SentryBridge.init(context, configuration)
}
diff --git a/sentry-samples/kmp-app/iosApp/iosApp/iOSApp.swift b/sentry-samples/kmp-app/iosApp/iosApp/iOSApp.swift
index 827559ab..87fa7450 100644
--- a/sentry-samples/kmp-app/iosApp/iosApp/iOSApp.swift
+++ b/sentry-samples/kmp-app/iosApp/iosApp/iOSApp.swift
@@ -3,15 +3,15 @@ import shared
@main
struct iOSApp: App {
- let sentry = Sentry()
-
+ let sentry = Sentry.shared
+
init() {
// Initialize Sentry using shared code
AppSetupKt.initializeSentry()
// Shared scope across all platforms
AppSetupKt.configureSentryScope()
-
+
// Add platform specific scope in addition to the shared scope
sentry.configureScope { scope in
scope.setContext(key: "iOS Context", value: [
From c015009b991d38f5f7a72150b17158da84112a67 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 14:57:36 +0200
Subject: [PATCH 2/6] Update changelog
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c1927f0..5ac0bf41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## 0.0.3
+### Features
+
+- Improve Objc/Swift experience with @HiddenFromObjc ([#62](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/62))
+
### Fixes
- fix: crash on Android API levels 23 and below ([#61](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/61))
From 6d3d24a642a6c3b949bbaabc8203bf5452c801e3 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 16:08:35 +0200
Subject: [PATCH 3/6] Update changelog
---
CHANGELOG.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ac0bf41..b94730a2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,13 @@
# Changelog
-## 0.0.3
+## Unreleased
### Features
- Improve Objc/Swift experience with @HiddenFromObjc ([#62](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/62))
+## 0.0.3
+
### Fixes
- fix: crash on Android API levels 23 and below ([#61](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/61))
From a435976b791c7dc167d5618e445865c5faa8cde9 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 16:39:51 +0200
Subject: [PATCH 4/6] add kotlin badge
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index aeec5845..0c49bd66 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,8 @@
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.
+[](https://kotlinlang.org)
+
| Packages | Maven Central
|-----------------------------------------| -------
| sentry-kotlin-multiplatform | [](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform)
From 2e98a7d5859e8e93fab13ce1367d556c0b1efcb7 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 16:40:28 +0200
Subject: [PATCH 5/6] change position
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0c49bd66..b170d097 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,11 @@
Experimental Sentry SDK for Kotlin Multiplatform
+[](https://kotlinlang.org)
+
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.
-[](https://kotlinlang.org)
-
| Packages | Maven Central
|-----------------------------------------| -------
| sentry-kotlin-multiplatform | [](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform)
From e123a38149419353075415db79d784de478c8298 Mon Sep 17 00:00:00 2001
From: buenaflor
Date: Wed, 29 Mar 2023 16:47:26 +0200
Subject: [PATCH 6/6] change position
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index b170d097..0c49bd66 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,11 @@
Experimental Sentry SDK for Kotlin Multiplatform
-[](https://kotlinlang.org)
-
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.
+[](https://kotlinlang.org)
+
| Packages | Maven Central
|-----------------------------------------| -------
| sentry-kotlin-multiplatform | [](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-kotlin-multiplatform)