Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Webview source/uri cannot load base64 pdf #22416

Closed
ColinKrist opened this issue Nov 26, 2018 · 2 comments

Comments

@ColinKrist
Copy link

commented Nov 26, 2018

Environment

Run react-native info in your terminal and paste its contents here.
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
Memory: 5.54 GB / 15.89 GB
Binaries:
Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.1.0.0 AI-173.4720617

Description

Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.

Prior to React Native 57+ Webview could load a base64 pdf on iOS since it was supported natively on UIWebview. After Expo recently upgraded to RN 57+ (Expo 31) our team hit this issue when using rn-pdf-reader-js since this library uses this functionality.

Usage

let data = "data:application/pdf;base64," + pdfbase64Data;

jsx:
<WebView
  style={{ flex: 1}}
  source={{ uri: data}}
/>

When loading the Webview we now get a promise rejection from resolveAssetSource().

yellowbox
NOTE: this image was taken from the expo forum post for rn-pdf-reader-js

NOTE: we haven't tried this with react-native-community/react-native-webview since it hasn't landed, but it seems that they have this working in their repository.

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

@hramos

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2018

Please use https://github.com/react-native-community/react-native-webview and file a bug there if you have issues.

@hramos hramos closed this Nov 30, 2018

@hughbe

This comment has been minimized.

Copy link

commented Jan 10, 2019

Anyone figured out a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.