When sharing images and videos via the share extension, expo-share-extension creates a sharedData directory in the app group's container and stores the image/video files in it. These files are not removed automatically, because expo-share-extension can't know when you're done processing them. You also should not not remove them, because that would unnecessarily use up your users' storage capacity.
Implementation
This PR introduces an async clearAppGroupContainer method, which you can import from expo-share-extension to empty the sharedData directory at your own terms (e.g. after you're done processing the shared files).
See examples/with-media/app/create.tsx for an example implementation
Motivation
When sharing images and videos via the share extension,
expo-share-extension
creates asharedData
directory in the app group's container and stores the image/video files in it. These files are not removed automatically, becauseexpo-share-extension
can't know when you're done processing them. You also should not not remove them, because that would unnecessarily use up your users' storage capacity.Implementation
This PR introduces an async
clearAppGroupContainer
method, which you can import fromexpo-share-extension
to empty thesharedData
directory at your own terms (e.g. after you're done processing the shared files).See
examples/with-media/app/create.tsx
for an example implementation