react-native-share-menu
react-native-share-menu copied to clipboard
Ensure iOS share extension can load files of all types, from all apps
We've encountered issues with being able to consistently load file data from all apps. It seems individual apps are responsible for constructing their own data to share to the point that they don't all behave the same. In addition, with some changes, we've seen apps work on the simulator but not a physical device (i.e., Photos).
Example 1: Files app
Upon trying to share a file from the Files app on iOS, the share extension will crash here. The data
object provided by the Files app cannot be past to a URL, but the data
object in the same method provided by the photos app is a URL.
To fix this, we changed forTypeIdentifier
to kUTTypeFileUrl
, which makes the apps on the simulator work correctly. However, upon testing on a physical device, shares from the Photos app start crashing with this change instead.
In scope:
- Find a way to update
storeFile
such that it can handle file shares from a wide variety of apps. Test the changes both on the simulator (sharing from Photos and Files apps), as well as on a physical device (Photos, Files, in addition to other apps like Google Drive, etc).
Out of scope:
- Fixing mime-type data reported about files. This will be covered in #291
- Testing with more than one file