From e4a967ff43cc2ee624e3684085e97016767c4872 Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Sat, 29 Oct 2022 17:59:46 +0200 Subject: [PATCH] docs(share_plus): #1299 document XFile.fromData (#1300) Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com> --- packages/share_plus/share_plus/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 6c25bfe642..013ddc57e6 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -71,6 +71,16 @@ Check out our documentation website to learn more. [Plus plugins documentation]( ## Known Issues +### Sharing data created with XFile.fromData + +When sharing data created with `XFile.fromData`, the plugin will write a temporal file inside the cache directory of the app, so it can be shared. + +Althouth the OS should take care of deleting those files, it is advised, that you clean up this data once in a while (e.g. on app start). + +You can access this directory using [path_provider](https://pub.dev/packages/path_provider) [getTemporaryDirectory](https://pub.dev/documentation/path_provider/latest/path_provider/getTemporaryDirectory.html). + +Alternatively, don't use `XFile.fromData` and instead write the data down to a `File` with a path before sharing it, so you control when to delete it. + ### Mobile platforms (Android and iOS) #### Facebook limitations (WhatsApp, Instagram, Facebook Messenger)