• ankushg

    ankushg

    1 year ago
    Is there a way to expose an
    interface
    from Kotlin which declares suspend funs (or some other async construct), and have an iOS app app directly implement the interface in Swift, rather than implementing it through KMP? Our mobile data layers are currently platform-specific and have a ton of moving parts. It's definitely not a short-term project to convert them to KMP (and we're not sure if we would ever really want to). We do however want to migrate more logic into KMP! We were hoping there's a way to: • define KMP interfaces for Use Cases/Interactors, • implement those interfaces using our (non-KMP) data layers in iOS/Android, and then • constructor-inject those Use Case implementations into a KMP ViewModel, using them from common code Anyone have any insight?
    ankushg
    s
    +3
    11 replies
    Copy to Clipboard
  • German Politov

    German Politov

    1 year ago
    Hello everyone! Does somebody know if there is any public repository with the multiplatform sample project that supports three targets simultaneously:
    Android
    ,
    iOS
    and
    JS
    ? I've already successfully developed KMP targeting Android and iOS with simple shared code that makes API call to Google Photos endpoint and shows fetched photos in the apps on both platforms(Android/iOS), now I want to add JS support to the project by creating a simple JS(or React) page that will use that shared code also. Please share the links to repositories or documentation how to combine three targets in one KMP if you know such.
    German Politov
    steelahhh
    +1
    4 replies
    Copy to Clipboard
  • d

    Daniele B

    1 year ago
    Does the KMM portal load to you? It doesn’t to me:https://kotlinlang.org/docs/mobile/getting-started.html
    d
    andylamax
    2 replies
    Copy to Clipboard
  • Umar Ata

    Umar Ata

    1 year ago
    Hi there,
    I have a method in commonMain in SharedClass 
    @Throws(Exception::class)
         fun feed(value: DoubleArray) {
    ..
    }
    and it inputs DoubleArray and I can pass that without any issues from Android Kotlin project but in iOS there is no such data type and I have
     let floatArray1 = Array(UnsafeBufferPointer(start: buf.floatChannelData![1], count:Int(buf.frameLength)))
    but I cannot pass it to my method in commonMain
    so for this I created another method in Kotlin in which first I convert the float array in swift to NSMutable String array then pass it to that method and in that method I create a DoubleArray and then initialise in ForEachIndex loop
    
    @Throws(Exception::class)
        fun getDoubleArrayFromStringList(doubleArray: ArrayList<String>, printLog: Boolean?): DoubleArray {
            if (printLog == true) println("given array:$doubleArray")
            val signal = DoubleArray(doubleArray.count())
            doubleArray.forEachIndexed { index, str ->
                    val doubleValue = (str.toDouble())
                    signal[index] = doubleValue
            }
            if (printLog == true) println("converted array:${signal.contentToString()}")
            return signal
        }
    Is there any easy solution for my problem
    Umar Ata
    alex009
    3 replies
    Copy to Clipboard
  • Elnur Jeksenov

    Elnur Jeksenov

    1 year ago
    Hi guys👋 My android project contains three modules: 1. app 2. ui(jetpack compose) 3. sdk(kotlin multiplatform, ktor client) So I’m making requests to server in sdk(kotlin multiplatform) module. I want to upload file via multipart-form-data, but there is no support for java.io.file in kotlin multiplatform. Have you got any idea to solve this problem?
    Elnur Jeksenov
    a
    +1
    10 replies
    Copy to Clipboard
  • r

    Rhony

    1 year ago
    Anybody here already use moko mvvm and mobile-multiplatform-gradle-plugin ? I try to learn kmm using this library but still fail to build ios project. I’m also try to follow their cocoapods setup but still unable to build the ios package. Really appreciate If anybody want to make a pull request on my public repository.
    r
    Giorgos Neokleous
    +1
    13 replies
    Copy to Clipboard
  • d

    Daniele B

    1 year ago
    As announced last week, I am now finally publishing the article about my research in KMP and Declarating UIs, using the MVI pattern. I am presenting the D-KMP architecture, which allows 85% of shared code. I hope this can bring useful elements to promote Kotlin MultiPlatform!https://twitter.com/dbaroncellimob/status/1329044480515772420?s=09
    d
    t
    +5
    45 replies
    Copy to Clipboard
  • a

    Azur Haljeta

    1 year ago
    What do I need to do to have a KMM project working well with Xcode and cocoapods? I want to drop the
    packForXcode
    task and instead use cocoapods. And I also want to be able to add iOS-specific libraries directly into
    build.gradle.kts
    , like AFNetworking. I know that this is possible and doable but... Is there a complete example out there? I've tried the following but there ae always some issues...
    a
    k
    +1
    9 replies
    Copy to Clipboard
  • o

    Oleh

    1 year ago
    Anyone had issue on ios side with
    Ktor native HttpClient requires kotlinx.coroutines version with 'native-mt' suffix (like '1.3.9-native-mt'). Consider checking the dependencies.
    message? I’m using 1.4.1 
    ktor
     in the multiplatform project?
    o
    John O'Reilly
    4 replies
    Copy to Clipboard