https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

Pallaw Pathak

12/08/2023, 6:14 AM
"Hi everyone, I'm wondering if there's a library available for Kotlin Multiplatform (KMP) that replicates the sharing functionality similar to what Android offers. For example, in Android, we can share a link using
Intent shareIntent =Intent.createChooser(sendIntent, null); startActivity(shareIntent)
. Is there an equivalent approach or library in KMP for this purpose?"
p

Pablichjenkov

12/08/2023, 6:21 AM
What makes KMP spicy and trendy is that you can still do that in your same Android code. Just pass a delegate interface to KMP. From KMP invoke the onClick button that triggers this action. In the actual Android implementation, use this exact code. In iOS do the proper iOS code
p

Pallaw Pathak

12/08/2023, 6:24 AM
I plan to follow the approach you've recommended. However, before I start coding from scratch, I'm curious to know if there exists a Kotlin Multiplatform (KMP) library that already addresses this specific issue?
p

Pablichjenkov

12/08/2023, 6:35 AM
I am not sure if one of the recommended navigation libraries support this type of system navigation. You can ask about this in #appyx or #decompose channels or PreCompose, Voyager or Circuit GitHub repos. I haven't seen anything yet but is possible some of this library manage that. But I am not aware of anything like this yet
p

Pallaw Pathak

12/08/2023, 6:38 AM
Thanks for your suggestion @Pablichjenkov CC @Suresh Maidaragi
👍 1
j

Jan Holešovský

12/08/2023, 9:38 AM
If a closed source solution is OK for you, we have an Android-alike API for KMP; supports Intents, Activities, lifecycle etc. Happy to share a link, but I've pasted it recently here & don't want to spam 😉 - will DM you if you are interested?
👍 1
p

Pallaw Pathak

12/08/2023, 9:39 AM
@Jan Holešovský It would be great if you could share the same.
j

Jan Holešovský

12/08/2023, 9:43 AM
Sent the link via DM
👎 1
p

Pallaw Pathak

12/13/2023, 7:56 AM
@Jan Holešovský The resource you provided doesn't appear to be relevant to the specified problem. It seems like you might be promoting your product, which is not welcomed. 👎
j

Jan Holešovský

12/13/2023, 9:50 AM
I've asked if you were interested in closed source solution to your problem, you said you were, so I've sent you the info. It makes your original
Intent shareIntent =Intent.createChooser(sendIntent, null); startActivity(shareIntent)
compile and work on iOS, so I believe it is relevant. I'm sorry if you find it not helpful.
3 Views