Is anyone aware of any examples of doing a multipa...
# multiplatform
j
Is anyone aware of any examples of doing a multipart/form-data based file upload in say
iosMain
in shared KMP code (using
NSURLSession
etc)?
I know this can be done with Ktor but was hoping to be able to use
NSURLSessionConfiguration.backgroundSessionConfiguration
etc so upload could be done in the background (unless there's other way to do that?)
Probably a decent start to what you want
j
I could be wrong here but think we're somewhat constrained in KMP code to using
NSURLSession
based APIs.....but perhaps that can be adapted....will take a look thanks
(Just to clarify btw....was looking to do this in Kotlin code in
iosMain
.....could also potentially "delegate" this to Swift code though some callback etc....might end up going down that path)
k
Especially if you want to do this in background tasks, I think delegating to Swift is going to be what you want
Even in Swift-only land this is not well supported
j
I think running in background task might still be possible in shared Kotlin code using
NSURLSessionConfiguration.backgroundSessionConfiguration
d
@John O'Reilly kindly update us on your preferred approach ,will be very grateful, i was thinking of a work around of the same.
j
Currently trying using alamofire library in Swift
d
Ooh great , thanks @John O'Reilly