amplitude / Amplitude-Kotlin

Amplitude Kotlin SDK
MIT License
27 stars 10 forks source link

setUserId doesn't work #119

Closed rahulTeladoc closed 1 year ago

rahulTeladoc commented 1 year ago

Expected Behavior

User must be visible in Amplitude Dashboard. When i added setUserId events got disappear.

Current Behavior

It show show Amplitude Id and userId as null.

when i try to set user Id, then event itself not visible.

fun provideAmplitudeInstance(): Amplitude {
        val amplitude = Amplitude( Configuration(
            apiKey = "API Key",
            context = ApiInstance.appContext,
            plan = provideDefaultObservePlan(),
            trackingSessionEvents = false
        )).also { amplitude ->
            providePlugins().forEach { plugin ->
                amplitude.add(plugin)
            }
        }
        amplitude.setUserId("12345")

        return amplitude
    }

I am using this function like this : private val client: Amplitude by lazy(LazyThreadSafetyMode.NONE) {}

JammyZ commented 1 year ago

We met the same issue here with com.amplitude:analytics-android 1.11.0. Is there any update for this issue?

rahulTeladoc commented 1 year ago

We met the same issue here with com.amplitude:analytics-android 1.11.0. Is there any update for this issue?

check your user id length if its less than 5 then you will have this issue.

or else update 'minIdLength' in Configuration.