mostafa-mansour1 / previewAnyFile

Cordova Plugin to preview any file in native mode by providing the local or external URL
MIT License
33 stars 30 forks source link

Bug: previewAnyFile does not work with encoded links like Firebase Storage #35

Open iAMkVIN-S opened 3 years ago

iAMkVIN-S commented 3 years ago

Ionic: Ionic CLI : 6.12.4 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/react 6.0.0-beta.5 Utility: cordova-res : 0.15.3 native-run : 1.4.1 System: NodeJS : v14.4.0 (/usr/local/bin/node) npm : 6.14.5 OS : macOS Big Sur

Running an Ionic Application using React.

The URL passed to PreviewAnyFile.previewPath does not work if it's a Firebase Storage URL

I noticed another user proposing to use a decoder, however if you decode the Firebase URL and replace the %2F with a /, Firebase will not return you an image anymore.

Code: image

Error: image

I tried passing both a name.ext (name.jpeg) and mime type (image/jpeg). I also tried adding the extension to the Firebase URL, which doesn't break the URL, but still doesn't work in the plugin.

Cheers

mostafa-mansour1 commented 3 years ago

can you provide me an example of Firebase Storage URL to check from my side

venkaa28 commented 3 years ago

https://firebasestorage.googleapis.com/v0/b/app_name/o/folder%2Ffolder%2Ffile_name?alt=media&token=token_id

This is an example URL, I'm having the same issue as the person above. The app name, folder names, file name, and token id were replaced for safety sake.

venkaa28 commented 2 years ago

Any update on this issue?