MaxAst / expo-share-extension

Expo config plugin for creating iOS share extensions with a custom view.
MIT License
205 stars 4 forks source link

Add ability to share images and videos #24

Closed MaxAst closed 4 months ago

MaxAst commented 4 months ago

This PR makes it possible to use the share extension on an image or video. The share extension retrieves the file URL of the given image or video and adds it to the images or videos array as part of initial props.

Displaying the image or video in the share extension could lead to memory issues, so this needs to be used with caution. I haven't figured out how to redirect to the host app, since this does not seem to be officially supported according to the docs:

A Today widget (and no other app extension type) can ask the system to open its containing app by calling the openURL:completionHandler: method of the NSExtensionContext class

If I find a workaround to redirect to the main app, the file URL of the shared image/video could be passed as part of the route or as part of a shared storage like mmkv

In addition, this PR: