Konfetti icon indicating copy to clipboard operation
Konfetti copied to clipboard

Support for Kotlin Multiplatform: Android/iOS/JS

Open mkpazon opened this issue 1 year ago • 10 comments

mkpazon avatar Jan 03 '24 14:01 mkpazon

Curious, has anyone assessed the effort involved in this?

creativedrewy avatar Jan 10 '24 22:01 creativedrewy

Multiplatform support should be possible. I already started an effort to support Desktop compose by moving out any Android references from the core module https://github.com/DanielMartinus/Konfetti/pull/321

I've successfully built a desktop compose app using the new core module and implementing a wrapper for KonfettiView and DrawShapes using that core module.

If you want to play with it, all you need to do is import the new core module that I made available as a beta: implementation("nl.dionsegijn:konfetti-core:2.1.0-beta01")

It's basically a copy of what's inside the xml or compose module here but then using the api's of that platform.

DanielMartinus avatar Jan 25 '24 21:01 DanielMartinus

Any timeline on the support for Compose Multiplatform? Is there a way we could help?

bmilovanovic avatar Mar 06 '24 17:03 bmilovanovic

Hey @DanielMartinus, I like your library a lot. Great idea! We used it already 3-4 years ago in some production apps. As now compose multiplatform is official supported by google, I started yesterday to migrate Konfetti to kmp. As you already wrote desktop was a fast one and I think ios & wasm should now be also possible.

Here is my fork: https://github.com/nilsjr/Konfetti/tree/feature/kmp

Maybe we can find some synergies with your approach.

Current state: Work in progress but tests & all samples are running :D

nilsjr avatar Jun 16 '24 11:06 nilsjr

Hi @nilsjr, how can I use your library?

bmilovanovic avatar Jul 04 '24 09:07 bmilovanovic

Hey @bmilovanovic, you can checkout my fork and build it locally with publishToMavenLocal. After that you can use it in your project by adding mavenLocal() to your repositories. There is no multiplatform artifact yet because these changes are not merged.

Still waiting for feedback

nilsjr avatar Jul 04 '24 10:07 nilsjr

Hi @nilsjr, I have tried that but when I try to publish an error pops up: Cannot perform signing task ':konfetti:compose:signReleasePublication' because it has no configured signatory Do I need to modify the code somehow? Thanks in advance

bmilovanovic avatar Jul 20 '24 12:07 bmilovanovic

@nilsjr Previous was error on the main branch. After I switched to feature/kmp, a new error appeared when running publishToMavenLocal: Cannot locate tasks that match ':konfetti:publishToMavenLocal' as task 'publishToMavenLocal' not found in project ':konfetti'.

bmilovanovic avatar Jul 20 '24 19:07 bmilovanovic

@bmilovanovic Yeah I will take a look

nilsjr avatar Jul 29 '24 07:07 nilsjr