-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin Multiplatform Library #8
Comments
We now internally maintain a basic multiplatform wrapper for posthog android and ios targets. If somebody is interested we can share it as open source. |
We're currently reworking the Android SDK and it's rewritten in Kotlin, still has Java dependencies e.g. Gson but it'd be much easier to write a KMP wrapper on top of it. Stay tuned. |
A quick workaround, for now, is to just call the API directly until we provide first-class support for Kotlin Multiplatform. |
@marandaneto any eta on this? |
@ar-g We are not focused on that right now since there's not a lot of demand, usually we prioritize depending on the number of requests, very user-centric. Instead of writing a new SDK, it might be easier to start with a wrapper SDK similar to https://github.com/postHog/posthog-flutter which just forwards the call to the Native SDKs (Android, iOS, and the JS SDK). Would that help? Would you be willing to submit a PR? I'm happy to guide you and review it, let me know if that would be an alternative. |
@marandaneto our end goal is to use it in our own library that shipped to different clients, practically speaking we don't need any native bindings, screen tracking and such. Do we even need in that case to write a wrapper for other sdks, wouldn't it make more sense to implement own sender of events instead? What we want to do is track transaction failure events that include versions and different metadata. |
@ar-g most likely a pure client would make more sense, yes, more lightweight.
That is doable with the API, yes, if you don't need offline caching, that's easy.
Let me check that.
That is correct, filtering is fine.
I'd need to understand a bit more about what exactly you wanna track but dashboards and filtering should not be a problem. |
Integrating Posthog in Kotlin multiplatform projects currently requires integrating the android and ios libraries separatly. With a multiplatform library the code for android and ios must not be duplicated and user must not themself create expect/actual declarations for PostHog. The kotlin library can also be used nativly in android only projects.
The text was updated successfully, but these errors were encountered: