Native file documents sample project

Category: Samples
Subcategory: Examples

Overview

Sample project for Native File Documents module.

Documentation

Demo url

Description

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. 

Be advised that incorrect usage of the JavaScript actions in this module can cause issues in your app, like deleting files that you did not create yourself. We do not accept any liability or responsibility!

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

Examples of:

  • 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.

Dependencies

Installation

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.

Android specific

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.

Releases

Version: 4.1.0
Framework Version: 9.12.2
Release Notes: Added sample for image cropping
Version: 4.0.1
Framework Version: 9.12.2
Release Notes: Small fix in take picture nanoflow for testing image cropper
Version: 4.0.0
Framework Version: 9.12.1
Release Notes: Mendix 9.12.1 Example of custom logic to turn logging on or off.
Version: 3.3.1
Framework Version: 9.6.5
Release Notes: Added sample to upload device log files to the Mendix backend as FileDocuments
Version: 3.3.0
Framework Version: 9.6.5
Release Notes: Added file logger demo