Did anyone ever do a kmm image picker? For my use ...
# multiplatform
a
Did anyone ever do a kmm image picker? For my use case its enough if it works for iOS and Android (KMM Project with Compose Multiplatform). I guess I can easily enough implement an image picker via expect/actual that triggers the platform image picker.. consuming the result (showing the picked images in a list for example, storing a reference to the images that have been picked etc) could be kind of a little more tricky I guess. Is there maybe a sample or library I could use as a guide?
👍 1
It’s a good guide, I guess I can copy + paste and adapt their implementation since I will need more than just a byte array
h
I added enhancement of that project for run time permission android : https://kotlinlang.slack.com/archives/C3PQML5NU/p1723244721742759
v
@Alex FileKit could be an option to easily pick images. Like Peekaboo, it leverage native UI on Android and iOS for image and video selection. It targets Android & iOS (and more) and we can access returned file information from the common code like bytes, path, file name, extension, size through an utility object called PlatformFile. From PlatformFile, we have still access to the underling file (Uri on Android and NSURL on iOS). If you want to extends the capacities of PlatformFile, it's easy as creating an extension function on it. And here are some examples: a filekit sample, GeminiKMP from joreilly, an extension of PlatformFile in supabase sample
👍 2
❤️ 1
a
Looks very cool @Vincent! I will check it out, thank you!
🙌 1
226 Views