Native file documents sample project
Sample project for Native File Documents module.
Shows functionality of the Native File Documents module.
Access the file system of the native device. View file documents on the device, as temporary solution until the Mendix platform supports this.
Due to the nature of this module, it comes with a disclaimer and warning, by using this module you accept and agree to it:
This module provides a convenient way for viewing files and images. However, it is an advanced, highly technical module! You need to create a custom build to use it, it does not work in the Make It Native app!
The module is free to use, as is, and we will update it regularly for new Mendix releases.
Unfortunately, we cannot provide extended support on using this module.
If you are interested we are of course willing to provide assistance, you may contact use here: https://developer.mendixcloud.com/link/partnerprofile/4808
Typical usage scenario
View file documents on the device. Access the file system of the native device.
Features and limitations
- Viewing files,
- Viewing PDFs in the app itself
- Selecting files from the device storage
- Resizing images
- Cropping images
- Writing content to files.
- Reading contents of files.
- Listing directory contents.
- Writing to text files.
- Basic logging using text files.
- Mendix 9: Native dependencies are included automatically when you build the app
- Mendix 8: Node modules react-native-fs, react-native-file-viewer, react-native-share and react-native-document-picker
Download the Mendix appstore module.
Create a custom native build which includes the configured node modules listed above.
To test your app, you will need to use a custom dev app because the Make It Native app does not have the required native modules.
Note that just using npm install is sufficient for the modules to work. React native link is no longer necessary.
Create a native build using the native builder UI. You need at least version 1.0.78 and allow it to update the native template if it prompts you for the update. The additional native module dependencies will be included automatically during the native build for Mx9.
When building for Mx8, use npm install to include the native dependencies react-native-fs, react-native-file-viewer, react-native-share and react-native-document-picker.
Also run pod install in the ios folder again for iOS builds.
You need to add a query to the Android Manifest for Android 11 and up. Place it directly before the close tag, see screenshot. Note that recent versions of the native template add a similar intent by default so you no longer need to do this manually.