mobileMain (see shared source sets).


Usage
onError in Compose, or are thrown as a FileKitDialogException by the suspend API. See Results and errors.
Options
PlatformFile | List<PlatformFile>
required
launch()
What to share. An empty list does nothing.
Platform-specific settings. In the suspend API, pass it to
shareFile().Platform notes
Android setup
Only needed for files outsideFileKit.filesDir and FileKit.cacheDir. filekit-dialogs already ships a FileProvider (${applicationId}.FileKitFileProvider) that covers those two directories, and content:// files returned by the pickers need no provider at all. For any other location, such as getExternalFilesDir(), FileProvider throws an IllegalArgumentException until you declare your own provider.
1
Declare a provider in your manifest
AndroidManifest.xml
2
List the directories it may expose
Add one entry per location you use, for example app-specific external storage:See FileProvider for every path type.
res/xml/file_paths.xml
3
Pass the authority to FileKit
The
authority parameter exists only on Android, so build these settings in androidMain:androidMain
A custom
authority applies to every file in the share. If you share files from several directories at once, for example filesDir and getExternalFilesDir(), your provider’s file_paths.xml must cover all of them. Otherwise FileKit throws an IllegalArgumentException before the share sheet opens.Related
- Open with default app to view a file instead of sending it.
- Camera picker to capture a photo to share.