sentry-kotlin-multiplatform icon indicating copy to clipboard operation
sentry-kotlin-multiplatform copied to clipboard

Missing cinterop for SentrySessionReplayIntegration

Open Legion2 opened this issue 1 year ago • 9 comments

Problem Statement

I want to use session replay on mobile, but on ios the cinterop is missing some types.

Solution Brainstorm

I want to be able to configure session replay in kotlin multiplatform code. Or atleast have access to the objectc definitions

Legion2 avatar Sep 23 '24 13:09 Legion2

hey which sentry cocoa and kmp version are you using?

buenaflor avatar Sep 23 '24 13:09 buenaflor

kmp 0.9.0 and cocoa 8.36.0

Legion2 avatar Sep 23 '24 18:09 Legion2

can you check if the same problem exists on 0.8.0

buenaflor avatar Sep 23 '24 19:09 buenaflor

I cannot downgrade, because i use the mobile replay which is only available in 0.9.0

Legion2 avatar Sep 23 '24 23:09 Legion2

0.8.0 internally uses cocoa version 8.36.0 to create the cinterop bindings so theoretically it should also have the replay options

buenaflor avatar Sep 23 '24 23:09 buenaflor

how do you use the KMP init btw?

Sentry.init or Sentry.initWithPlatformOptions

buenaflor avatar Sep 26 '24 11:09 buenaflor

I use Sentry.initWithPlatformOptions to access the replay API which is not available in common code.

Legion2 avatar Sep 26 '24 12:09 Legion2

it is available for me locally:

actual fun createPlatformOptionsConfiguration(): PlatformOptionsConfiguration = {
    it.dsn = "..."
    it.experimental.sessionReplay().setOnErrorSampleRate(1.0f)
}

this is tested in the sample app in the kmp repo

buenaflor avatar Sep 26 '24 13:09 buenaflor

if you want to access it in common code I'll add it soon

buenaflor avatar Sep 26 '24 13:09 buenaflor