prepareFileForSharing

suspend fun prepareFileForSharing(context: Context, fileDataProvider: DataProvider, fileName: String?): Uri

Writes file to directory backed by DocumentSharingProvider.

Return

Uri that can be used for sharing the file to other apps.

Parameters

context

Context to use.

fileDataProvider

Data provider with file data.

fileName

Optional file name used for sharing (this is the shared file name as seen by other apps).

Throws

if the file could not be exported.