Can anyone please provide sample code for displaying a PDF in React Native? iOS and Android.
This is what I've tried:
render: function() {
return <WebView
source={require('./my.pdf')}
/>
}
^ This results in a Red Screen of Death with the "Unable to resolve module" error.
render: function() {
return <WebView
source={{uri: 'my.pdf'}}
/>
}
^ This gives an "Error Loading Page" message in the WebView. "The requested URL was not found on this server"
I know iOS is capable of showing a PDF in a UIWebView. I assume Android can do the same. There must be something in how the source is specified that I'm missing.