App icon indicating copy to clipboard operation
App copied to clipboard

Add image attachments

Open quinthar opened this issue 6 years ago • 15 comments

This would make it an amazing demo, but I don't think anyone expects it out of the gate.

quinthar avatar Aug 12 '20 06:08 quinthar

dupe, closing

quinthar avatar Aug 15 '20 04:08 quinthar

Oh actually this is different -- this is saying adding images; that's not super important, but displaying images is.

quinthar avatar Aug 15 '20 04:08 quinthar

Scrolling through my DMs, I add images/screenshot ALL the time. Bumping this to HIGH, adding to milestone and dropping another note in #deprecate-slack .

mallenexpensify avatar Aug 31 '20 18:08 mallenexpensify

We were just talking about this in #deprecate-slack and since there is not workaround at the moment, this is more likely Critical. Updating with that in mind.

JmillsExpensify avatar Sep 01 '20 21:09 JmillsExpensify

@ryanschaffer and I were chatting and testing earlier... When you get an email about a chat and you click the To respond, head over to Expensify link, it takes you to the report page on Expensify.com where you can click the paper clip on the right of the compose text box to upload an attachment. Ryan had the idea, as a quick fix, might it be possible to include a link from Chat to the report page where people can easily upload attachments? I think this is a solid quick-ish fix for PoC.

mallenexpensify avatar Sep 02 '20 01:09 mallenexpensify

might it be possible to include a link from Chat to the report page where people can easily upload attachments

This sounds easier than adding a new library, I can add that work around first so people have some way to upload attachments and then get an image/document picker working once that is in place.

In terms of a library, I think this library is our best bet, it adds web support to a popular RN document picker but is a bit outdated. This supports picking documents as well as images.

This alternative library adds web support to a popular image picker that just handles picking images, but hasn't been updated in a few years and requires expo, which I think is overkill for this.

Jag96 avatar Sep 03 '20 00:09 Jag96

Linking this one too.. since it might be related and great to look into after Make image quality higher #353 https://github.com/Expensify/ReactNativeChat/issues/353

mallenexpensify avatar Sep 03 '20 15:09 mallenexpensify

The PR with the temp fix is in review, for the real fix I've got a local branch working for basic web uploads using a shim web implementation of this library (which lacks web support), since the document picker library doesn't allow the user to open the gallery on mobile. There's an issue on the current version of RN causing local image uploads to fail, so I'll have a look at the potential fixes posted there next week: https://github.com/facebook/react-native/issues/29364.

Jag96 avatar Sep 05 '20 00:09 Jag96

Link PR was merged: #399

AndrewGable avatar Sep 09 '20 20:09 AndrewGable

@Jag96 - I didn't quite follow your statement: are you saying that there is a library designed to do precisely what we want, but it has a bug that causes it to not pull from the gallery on iPhone? And to work around that bug you created a new library? If so, I'd suggest not creating the new throwaway library, and instead we just try to get the "real" library's bug fixed (either by fixing it ourselves, or by hiring someone to do it).

quinthar avatar Sep 11 '20 02:09 quinthar

Additionally, if we have a solution that works right now everywhere but iOS, I think we should just use the "real" solution, and not do the link to E.com

quinthar avatar Sep 11 '20 02:09 quinthar

Sorry for the miscommunication, let me clarify the points individually

  • I have not found a library that works for web and mobile out of the box, and there currently isn't a solution that works right now everywhere but iOS
  • The outdated library I mentioned in https://github.com/Expensify/ReactNativeChat/issues/87#issuecomment-686152762 (Let's call this Library A) did work on web, but was outdated over a year from the initial fork for iOS/Android, is no longer maintained, and didn't work on iOS/Android, so it didn't make sense to me to try to submit PRs there to fix bugs.
  • The document picker library (the library that Library A forked off of, which does not have web support) does not allow you to pull images from the gallery on iOS, but works for images and files on Android. There are a few issues in that repo that ask how to choose images from the iOS gallery, but there are no answers outside of using a different library to pick images on iOS. It does not appear to be a bug, since this library is just a wrapper of UIDocumentPickerViewController, which doesn't open the gallery. There is a feature-request issue open to add this functionality here
  • The image picker library that I'm using now (which does not have web support) allows you to pick images from the gallery on iOS/Android, but does not have support for picking files.
  • React Native v63.0 has an issue where you can't upload local images. The PR for that is here, but its sitting in review. I've made a local change to one of the RN files to test as I go, but if that fix isn't merged when my PR is done we'll need to fix it another way in the meantime by adding a post-install script or downgrading the RN version temporarily.

Therefore, for this fix

  • I'm using the Image Picker library that supports image uploads on iOS/Android
  • I'm adding a shim lib to web that allows for image and document uploads, since none of these libs support web.

If we wanted to make PRs that add web support and both gallery/file picking so that we only have to use one library for everything, the next steps would be

  • Look into adding web support to https://github.com/Elyx0/react-native-document-picker/ using our web solution.
  • Have us internally look into Adding image gallery support to the document picker, or hire somebody else to do it
  • Once both of those are done and the document picker lib supports web and includes both an image and file picker, we remove the Image Picker lib and replace it with the updated document picker lib

If we wanted support for both gallery/file picking on ios/android without having to use just one library, we could add both the document-picker library and the image-picker library and implement something like this.

Jag96 avatar Sep 11 '20 18:09 Jag96

I think it could be cool to hire some Upwork contractor to try to shepherd these changes into the RN mainline branch. It would be good to figure out how hard that is in practice to do, and start building a name for ourselves.

quinthar avatar Sep 15 '20 04:09 quinthar

If anyone ends up working on hiring Upwork contractors, I'd like to be included on the process if possible.

mallenexpensify avatar Sep 16 '20 17:09 mallenexpensify

You can go for it -- just sign up for an Upwork account and go hire a contractor, then submit for reimbursement.

On Wed, Sep 16, 2020 at 10:44 AM Matt Allen [email protected] wrote:

If anyone ends up working on hiring Upwork contractors, I'd like to be included on the process if possible.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Expensify/ReactNativeChat/issues/87#issuecomment-693559200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMNUUFD6PXQ57NCP4AMNLSGD2RHANCNFSM4P4ETMUA .

quinthar avatar Sep 18 '20 02:09 quinthar