TheArchitect123 / KmpEssentials

KmpEssentials is a library that contains apis (40+ Modules) to accelerate your development. Everything from managing the Battery, File System, getting Package information, or taking Photos. Supports iOS, Android & AppleWatch
MIT License
159 stars 2 forks source link

[Feature] Add the way to complete "share file" flow. #8

Open Monabr opened 1 month ago

Monabr commented 1 month ago

Hello.

It would be nice to be able to create temporary files (this part is missing) with this library, to share it (this part is already there) also with the functions of this library.

TheArchitect123 commented 1 month ago

So a function where you can invoke which generates a random file, based on the file type passed to it? Can you give me an example?

Monabr commented 1 month ago

@TheArchitect123 Here is example.

            val filePath = KmpFileSystem.getTempCacheDirectory() + "/" + fileName + ".csv"

            val file = FileUtils.fromString(filePath, false)

            val stream = file?.openOutputStream()

            stream?.use { it.write(exportData) }

            KmpShare.shareFileWithAnyApp(filePath = filePath)

I should be able to do this by only using your library.