Skip to content

Commit

Permalink
docs(share_plus): #1299 document XFile.fromData
Browse files Browse the repository at this point in the history
Document the use of temporary directories and why developers should care about it.
  • Loading branch information
miquelbeltran authored Oct 28, 2022
1 parent c0539e8 commit afbc140
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/share_plus/share_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 adviced, that you clean up this data once in a while (e.g. on app start).

You can access this directory using `path_provider` 9getTemporaryDirectory](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.

### Mobile platforms (Android and iOS)

#### Facebook limitations (WhatsApp, Instagram, Facebook Messenger)
Expand Down

0 comments on commit afbc140

Please sign in to comment.