Expensify / react-native-share-menu

A module for React Native that adds your app to the share menu of the device
MIT License
632 stars 235 forks source link

Report content types more clearly (Android and iOS) #291

Open lindboe opened 7 months ago

lindboe commented 7 months ago

We need to be able to easily differentiate the type of data being shared so we can handle different cases. A few issues are enumerated below; these are combined into one issue so that if we need to introduce an API change on the JS side, we can ensure both iOS and Android can provide the same data.

Issues:

  1. We found that mime types were not being correctly detected for files shared from the Files app on iOS. We have an existing fix (https://github.com/Expensify/react-native-share-menu/pull/270) that we believe works, but needs testing once we've addressed #290.
  2. Some recent attempts at Android testing provided a content:// url, with no file name or extension, instead of a file URL that did include that information. Expensify needs this information for its functionality (displaying the filename, as well as not allowing SmartScan if the file is not compatible), and this will be easiest to implement in native code.
  3. Mime type is not always sufficient information for being able to distinguish content types. For example, a highlighted text string, a shared web page, and a text file would all currently have a mime type of text/plain, and to distinguish between those items, we'd have to employ a heuristic in JS to "guess" what type of value we've received. Let's explore if there are native tools we can use to provide more information about the content that was shared.

In scope:

Out of scope: