RocketChat / Rocket.Chat.ReactNative

Rocket.Chat mobile clients
https://rocket.chat
MIT License
1.97k stars 1.15k forks source link

Add react-native-pdf #2824

Open pratyaksh123 opened 3 years ago

pratyaksh123 commented 3 years ago

Description:

The current behavior of downloading pdf files is a webview implementation, which can be improved if we use an app-inbuilt pdf viewer that also allows us to leverage local document cache ( something similar to this PR https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/2809) and also pdf-thumbnails which can be a good UX.

Steps to reproduce:

  1. Open a pdf file from messages.

    Expected behavior:

    Should open a pdf viewer baked into the app

Actual behavior:

on iOS: opens the pdf in a webview, on android: file starts downloading.

Additional context:

kbatavia12 commented 3 years ago

@pratyaksh123 Can I take this up? Thanks.

pratyaksh123 commented 3 years ago

Yeah go ahead 👍

kbatavia12 commented 3 years ago

@pratyaksh123 Can you quickly guide me through it, I had a problem finding the source of the pdf file, can you tell me where to find it? Thanks.

kbatavia12 commented 3 years ago

@diegolmello @pratyaksh123 I keep getting the error "app:mergeExperimentalPlayDebugNativeLibs failed" when I add react-native-pdf to the project and then I cannot run it in debug mode. Can you please guide me on how to fix this error? Thanks in advance.

dudsdud commented 2 years ago

I have the same problem. The app downloads the file and sends me to the google store to download some reader. I believe it is a problem with the method of opening files from the rooms. Only happens on android. On iphone it works perfectly. Has anyone else encountered this same situation?