Hello guys , what is the best way to use Native libraries in both Apps , however there is the same lib implementation in both platforms Swift And Java (Libsodium)
c
Cicero
12/04/2020, 1:17 PM
If it doesn’t have a multiplatform module you will need to do it in both fronts. At least that is how I understand.
👍 1
h
HankG
12/04/2020, 1:25 PM
Related, how would run reference a multiplatform library so it shows up in XCode? I'm assuming it needs to have a framework built with it but the standard template for multiplatform libraries doesn't do that. I'm partially through experimenting with the concept and that was what I was landing on as a solution.
👍 1
(basically use it with the same ease one would the Kotlin code in the "shared" segment of a KMP project)
👍 1
c
Cicero
12/04/2020, 1:38 PM
I was quite confused by the quesiton so my notes go for libraries not ready for multiplatform but that have both targets. Like this guys stuff https://github.com/Ramotion
e
Elyes Ben Salah
12/04/2020, 1:38 PM
@HankG I have already the SDK Java and iOS for our library but I’m still confused of how I will reduce the code from both of them in the Shared , for example let say I have SecretKey which uses Native C lib sodium and I have both Swift and Java impl and the same object in both apps with the same implementation
and the Calls of API’s uses raw objects so I need to put those Entities in the Shared part , an those objects depends on the SecretKey
so how I can handle those cases (by the way I’m still new with Kotlin )
h
HankG
12/04/2020, 1:50 PM
I'm just learning KN, KMM, and KMP as well so I'd just have guesses
is there a Kotlin multiplatform library version of Sodium which supports JVM and iOS already? If so just referring ot that in common probably works
if you have to wrap it then having the expected class definition in common with actual implementation in the jvm and iOS folders would make it unified in the shared code.