diff --git a/CHANGELOG.md b/CHANGELOG.md index fdc3df54..4da6dc17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features - Improve Objc/Swift experience with @HiddenFromObjc ([#62](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/62)) +- feat: add view hierarchy ([#53](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/53)) ### Fixes diff --git a/README.md b/README.md index 0c49bd66..54873013 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ cocoapods { // ... // Make sure Sentry Cocoa in your project matches this version - pod("Sentry", "~> 8.2.0") + pod("Sentry", "~> 8.4.0") framework { baseName = "shared" diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index 5596953d..663f454b 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -27,7 +27,7 @@ object Config { val sentryAndroid = "io.sentry:sentry-android:$sentryJavaVersion" val sentryJava = "io.sentry:sentry:$sentryJavaVersion" - val sentryCocoaVersion = "8.2.0" + val sentryCocoaVersion = "8.4.0" val sentryCocoa = "Sentry" } diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec index e76009dc..54a741e6 100644 --- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec +++ b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |spec| spec.osx.deployment_target = '10.13' spec.tvos.deployment_target = '11.0' spec.watchos.deployment_target = '4.0' - spec.dependency 'Sentry', '~> 8.2.0' + spec.dependency 'Sentry', '~> 8.4.0' spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':sentry-kotlin-multiplatform', diff --git a/sentry-kotlin-multiplatform/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryAndroidOptionsExtensions.kt b/sentry-kotlin-multiplatform/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryAndroidOptionsExtensions.kt index b07be889..cca0dd82 100644 --- a/sentry-kotlin-multiplatform/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryAndroidOptionsExtensions.kt +++ b/sentry-kotlin-multiplatform/src/androidMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryAndroidOptionsExtensions.kt @@ -10,6 +10,7 @@ internal fun SentryOptions.toAndroidSentryOptionsCallback(): (SentryAndroidOptio // Apply Android specific options it.isAttachScreenshot = this.attachScreenshot + it.isAttachViewHierarchy = this.attachViewHierarchy it.sdkVersion?.name = this.sdk?.name ?: BuildKonfig.SENTRY_KMP_ANDROID_SDK_NAME it.sdkVersion?.version = this.sdk?.version ?: BuildKonfig.VERSION_NAME diff --git a/sentry-kotlin-multiplatform/src/commonIosMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.kt b/sentry-kotlin-multiplatform/src/commonIosMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.kt index 8bc62899..bb7638d1 100644 --- a/sentry-kotlin-multiplatform/src/commonIosMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.kt +++ b/sentry-kotlin-multiplatform/src/commonIosMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.kt @@ -9,4 +9,5 @@ internal fun SentryOptions.toIosOptionsConfiguration(): (CocoaSentryOptions?) -> // Apply iOS specific options it?.attachScreenshot = this.attachScreenshot + it?.attachViewHierarchy = this.attachViewHierarchy } diff --git a/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryOptions.kt b/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryOptions.kt index 8bee81eb..0a8faa83 100644 --- a/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryOptions.kt +++ b/sentry-kotlin-multiplatform/src/commonMain/kotlin/io/sentry/kotlin/multiplatform/SentryOptions.kt @@ -66,4 +66,10 @@ public open class SentryOptions { /** This variable controls the max attachment size in bytes */ public var maxAttachmentSize: Long = 20 * 1024 * 1024 + + /** + * Enables or disables the attach view hierarchy feature when an error happened. + * This is only available on iOS and Android. + */ + public var attachViewHierarchy: Boolean = false } diff --git a/sentry-samples/kmp-app/iosApp/Podfile.lock b/sentry-samples/kmp-app/iosApp/Podfile.lock index 4c553878..bfe0d33e 100644 --- a/sentry-samples/kmp-app/iosApp/Podfile.lock +++ b/sentry-samples/kmp-app/iosApp/Podfile.lock @@ -1,12 +1,12 @@ PODS: - - Sentry (8.2.0): - - Sentry/Core (= 8.2.0) - - SentryPrivate (= 8.2.0) - - Sentry/Core (8.2.0): - - SentryPrivate (= 8.2.0) - - SentryPrivate (8.2.0) + - Sentry (8.4.0): + - Sentry/Core (= 8.4.0) + - SentryPrivate (= 8.4.0) + - Sentry/Core (8.4.0): + - SentryPrivate (= 8.4.0) + - SentryPrivate (8.4.0) - shared (1.0): - - Sentry (~> 8.2.0) + - Sentry (~> 8.4.0) DEPENDENCIES: - shared (from `../shared`) @@ -21,9 +21,9 @@ EXTERNAL SOURCES: :path: "../shared" SPEC CHECKSUMS: - Sentry: cf1d35c866266da58964fe7b62526bda93ffcb38 - SentryPrivate: 2909bcc7b19a827b49e9bde0e56116b08d40dfdf - shared: 58db2d6937fef39d8b2c4c237ae769c9fef453f2 + Sentry: 16d46dd5ca10e7f4469a2611805a3de123188add + SentryPrivate: 2bb4f8d9ff558b25ac70b66c1dedc58a7c43630b + shared: 0dca2e824df822c0e0186869c320e4ba675f23ed PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756 diff --git a/sentry-samples/kmp-app/shared/shared.podspec b/sentry-samples/kmp-app/shared/shared.podspec index 8f9d4acc..14bc67a4 100644 --- a/sentry-samples/kmp-app/shared/shared.podspec +++ b/sentry-samples/kmp-app/shared/shared.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14.1' - spec.dependency 'Sentry', '~> 8.2.0' + spec.dependency 'Sentry', '~> 8.4.0' spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':sentry-samples:kmp-app:shared', diff --git a/sentry-samples/kmp-app/shared/src/commonMain/kotlin/sample.kmp.app/AppSetup.kt b/sentry-samples/kmp-app/shared/src/commonMain/kotlin/sample.kmp.app/AppSetup.kt index 10c5030c..37e05517 100644 --- a/sentry-samples/kmp-app/shared/src/commonMain/kotlin/sample.kmp.app/AppSetup.kt +++ b/sentry-samples/kmp-app/shared/src/commonMain/kotlin/sample.kmp.app/AppSetup.kt @@ -43,6 +43,7 @@ private fun optionsConfiguration(): OptionsConfiguration { it.attachStackTrace = true it.attachThreads = true it.attachScreenshot = true + it.attachViewHierarchy = true it.release = "kmp-release@0.0.1" it.beforeBreadcrumb = { breadcrumb -> breadcrumb.message = "Add message before every breadcrumb"