MobbScan Cordova: Optimize plugin
Introduction
MobbScan Cordova plugin contains the whole MobbScan features, such us document scan, video conference or facial validation with liveness. However, if you don't need any of these features, you can remove some libraries from you project so you can reduce your final application's size (either APK or IPA).
In this section you will check which features are included in this plugin and which framework you can remove if you are not using them. There are two methods of excluding functionality:
Console prompt
From version v2.18.9
to version v2.21.0
, once the prepare
step has finished, you will be asked if you want to remove some of the plugin features from your project, with this message in your console:
Do you need to exclude some of the MobbScan features from your project? Y/n
This is made in order to customize your installation, if don't need all the MobbScan features that the plugin has. By doing this, you can avoid adding extra size in your project. If you press the n
key, all features will be installed.
You will be asked to install the video conference feature, the liveness smile feature and the zxing
library (just for the Android platform). If you are not using any of them, just press the y
key when you are asked if you want to remove them.
Custom instalation with parameters
If you want to skip this questions step, from v2.19.4 you can execute the prepare
command adding these parameters:
Pameter | Function |
---|---|
-customize | By this flag, you can use the following parameters in order to exclude some functionalities |
-noPDF417 | Exclude the zxing library (just for the Android platform) |
Example:
Exclude the PDF417 feature:
$ npx cordova prepare -customize -noPDF417
$ npx ionic cordova prepare -customize -noPDF417
WARNING: The customization step for Ionic projects, by both parameter and console prompt process, is only supported from Ionic CLI 6. In previous versions customization during installation is not possible at all.