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

for expo 51 react-native-pdf is not working #856

Open
kuldip-trentium opened this issue Jul 26, 2024 · 2 comments
Open

for expo 51 react-native-pdf is not working #856

kuldip-trentium opened this issue Jul 26, 2024 · 2 comments

Comments

@kuldip-trentium
Copy link

What react-native version are you using?
0.74.3
What react-native-pdf version are you using?
6.7.5
What platform does your issue occur on? (android/ios/both)
both
Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
  2. Interesting logs

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?
<Pdf
source={{
uri: 'https://morth.nic.in/sites/default/files/dd12-13_0.pdf',
cache: true,
}}
trustAllCerts={false}
style={{
flex: 1,
width: "100%",
}}
onError={(error) => {
console.error(error, "error");
}}
/>

@kuldip-trentium kuldip-trentium changed the title for expo 51 not working for expo 51 react-native-pdf is not working Jul 26, 2024
@ngima
Copy link

ngima commented Jul 30, 2024

@kuldip-trentium
Are you using dev-client build or expo go?
What error/error logs are you getting?

I just tried it in v6.7.5 with expo 51 dev-client build with iOS and it's working for me

  <Pdf
    source={{ uri: 'http://samples.leanpub.com/thereactnativebook-sample.pdf', cache: true }}
    onLoadComplete={(numberOfPages, filePath) => {
        console.log(`Number of pages: ${numberOfPages}`);
    }}
    onPageChanged={(page, numberOfPages) => {
        console.log(`Current page: ${page}`);
    }}
    onError={(error) => {
        console.log(error);
    }}
    onPressLink={(uri) => {
        console.log(`Link pressed: ${uri}`);
    }}
    style={{
        flex: 1
    }} />

image

@ngima
Copy link

ngima commented Jul 30, 2024

I indeed had issue with Android that it was stuck on loading screen because of

[Error: ReactNativeBlobUtil request error: java.lang.IllegalStateException: Use of own trust manager but none definedjava.lang.IllegalStateException: Use of own trust manager but none defined]

Which is fixed with

<Pdf
  source={source}
  trustAllCerts={false}
  ....
  >

as mentioned in #568 (comment) comment from @ruipaulo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants