react-native-file-viewer | Native file viewer for React Native | iOS library
kandi X-RAY | react-native-file-viewer Summary
kandi X-RAY | react-native-file-viewer Summary
Native file viewer for React Native. Preview any type of file supported by the mobile device.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Opens a new file
- Emit an event
- Create JS modules
- Creates native file views
- Create view managers
react-native-file-viewer Key Features
react-native-file-viewer Examples and Code Snippets
Community Discussions
Trending Discussions on react-native-file-viewer
QUESTION
I am using react-native-fs to download files from server and save them. Once they are downloaded I am using react-native-file-viewer to open them. This process totally works fine: I am able to download and open it in the viewer, but I am not able to save the file in the File application from the viewer, though I can save in iCloud but not in the iPhone. The downloaded file is stored in a place like
...ANSWER
Answered 2020-May-27 at 11:13The below code downloads the file and opens it. In case the file already exists it will directly open it.
QUESTION
Im trying to pick a file (pdf-file) from a module called react-native-file-picker. This works ok, and gaves me name, type, path and uri.
After this, i display the name of the document that i picked in a flatlist.
Now, what i want is to "onPress" of the item in the flatlist, open the document with some pdf viewer or something like that.
I've already tried to use other modules like react-native-view-pdf and react-native-pdf and react-native-pdf-view but i cant access the state of my uri with either of them.
The last one that i used it was react-native-file-viewer and doesn't work very well because it doesn't open the item on press.
This is my actual code.
...ANSWER
Answered 2019-Sep-10 at 17:09Try to change the event handler from
QUESTION
I'm getting a crash on startup when running a React Native app on device, on release mode (debug mode works fine). The main error seems to be:
AndroidRuntime: java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
I've found various threads about this error but there are about old versions and none of the solutions provided was working.
The log is as follow:
...ANSWER
Answered 2018-Nov-29 at 12:15You don't specify which version of react-native you're using. I had the same issue with 0.57.3
, and the other answers put me on the right track: there was a bug in the android build system with android gradle plugin version 3.2, which was solved in 0.57.5
(changelog).
The bugfix is here and is very simple to manually integrate if you don't want to upgrade RN.
QUESTION
i have a problem with my react native project. when i trying to build the project (in android, windows 10, android emulator), i facing an error about collision between compile time version and runtime version of play-service-base.
I'm using:
...ANSWER
Answered 2019-Jul-22 at 17:25This comment on github provides the answer to your question
A dependency (react-native-device-info in this case) was using the latest version of one of its dependencies instead of a fixed/pinned version. When a new version of google services was released yesterday, it caused the build to pull in the new version for device-info, thereby causing the conflict with other dependencies that correctly pin the version they need.
QUESTION
I am writing a mobile app using react-native. Even though I did not touch any native side of my code, App started to be stopped just after running. I did some changes in react native components, but I did not use anything new. I debugged it in Android studio and here is the error:
...ANSWER
Answered 2018-Sep-15 at 11:44Guys one of my project's collaborators deleted package name in MainActivity.java class. It was awful. DO NOT EVER DELETE package name. Adding it again resolved it.
QUESTION
i try to use react-native-file-viewer for view à pdf file in my app.
I have import the lib like this : import FileViewer from 'react-native-file-viewer';
And i had make à function :
...ANSWER
Answered 2017-Dec-20 at 09:38I'm personnaly using react-native-pdf-view for android and a webView for ios, you can also use a google doc trick to read pdf in android webView but it requires a connection (more info here)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-file-viewer
Add the following to your Podfile:. Follow the instructions in the 'Linking Libraries' documentation on the react-native-windows GitHub repo. For the first step of adding the project to the Visual Studio solution file, the path to the project should be ../node_modules/react-native-file-viewer/windows/RNFileViewer/RNFileViewer.csproj.
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-file-viewer and add RNFileViewer.xcodeproj
In XCode, in the project navigator, select your project. Add libRNFileViewer.a to your project's Build Phases ➜ Link Binary With Libraries
Run your project (Cmd+R)
Open up android/app/src/main/java/[...]/MainApplication.java
Add import com.vinzscam.reactnativefileviewer.RNFileViewerPackage; to the imports at the top of the file
Add new RNFileViewerPackage() to the list returned by the getPackages() method
Append the following lines to android/settings.gradle: include ':react-native-file-viewer' project(':react-native-file-viewer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-file-viewer/android')
Insert the following lines inside the dependencies block in android/app/build.gradle: compile project(':react-native-file-viewer')
Locate react-native-file-viewer inside node_modules folder and copy android/src/main/res/xml/file_viewer_provider_paths.xml to your project res/xml/ directory
Add the following lines to AndroidManifest.xml between the main <application></application> tag: ... <application> ... <provider android:name="com.vinzscam.reactnativefileviewer.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_viewer_provider_paths" /> </provider> </application> ....
No function about file downloading has been implemented in this package. Use react-native-fs or any similar library for this purpose.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page