You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a solution. You need to implement an expect/actual function to format the byteArray to the Data class.
Common Main: expect fun createDataFromBytes(bytes: ByteArray): Data
Android Main: actual fun createDataFromBytes(bytes: ByteArray): Data { return Data(bytes) }
IOS Main: @OptIn(ExperimentalForeignApi::class) actual fun createDataFromBytes(bytes: ByteArray): Data { val nsData = bytes.usePinned { NSData.dataWithBytes(it.addressOf(0), bytes.size.toULong()) } return Data(nsData) }
Probably not the cleanest solution, but it works fine :)
Hi. I am trying to upload my bite array to Cloud Storage.
I am doing this
.putBytes(Data(byteArray))
but I see that expected declaration have no constructor.What should I do to upload data from common module?
The text was updated successfully, but these errors were encountered: