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

Christian Sousa

07/13/2020, 11:16 AM
Hello! Is there any way of using a javascript library on the multiplatform common code?
g

gildor

07/13/2020, 11:18 AM
no, common code cannot have any platoform-specific dependendencies
c

Christian Sousa

07/13/2020, 11:19 AM
Damn.. thanks for the quick answer! Do you know perhaps for something like this: https://github.com/InteractiveAdvertisingBureau/iabtcf-es but for Kotlin?
g

gildor

07/13/2020, 11:44 AM
No, I’m noty aware about any Kotlin only implementations, but you can declare expected interface and use platform specific libraries on platform code: https://kotlinlang.org/docs/reference/platform-specific-declarations.html
What kind platforms do you target?
c

Christian Sousa

07/13/2020, 11:49 AM
I’m targeting iOS and Android
g

gildor

07/13/2020, 11:52 AM
Looks that there is a java implementation too: https://github.com/InteractiveAdvertisingBureau/iabtcf-java
but for iOS you need C version of it
c

Christian Sousa

07/13/2020, 11:53 AM
yeah, that’s what i figured out 😛 I’ll need to see if I’m able to implement their stuff into a kotlin lib
g

gildor

07/13/2020, 11:55 AM
if there is some business logic on Java, you can convert it to Kotlin first, and try to get rid of platform specific declarations, as first step of porting Is not necessary easier, I think detects on project
2 Views