Plugin Quickstart
This page provides a comprehensive overview of the capabilities that users can unlock with Plugins in App Maker. By following a few straightforward steps, users can effortlessly create, publish, and utilize Plugins from projects beyond their own. Whether it's building custom functionalities or integrating third-party tools, the power of Plugins empowers users to enhance their App Maker experience effortlessly.
Create Plugin
To create the development environment for users to create their plugin, the following command should be executed in the project's root directory :
$ appmaker plugin create
Plugin names must be unique and comply with the akinon-react-native-camera formatting. Users can find the plugins they have created stored under the .plugins
directory within the project.
Installation Scripts
All changes that will affect project files must be developed within the ./plugins/YOUR_PLUGIN_NAME/installation
directory, specifically within the android and iOS files. For more information, please refer to here.
Run Installation Scripts
To run the scripts developed on the installation layer, follow these two steps:
First, execute the command
plugin preview
to preview the type of diff installation scripts will generate in project files. Use the following commands for Android and iOS respectively:
$ appmaker plugin preview android
$ appmaker plugin preview ios
After ensuring that installation scripts are running properly, users can proceed to edit the project files. To do this, run the command
plugin run
:
$ appmaker plugin run android
$ appmaker plugin run ios
To execute the plugin's Post Install scripts, simply add the —-post-install
parameter.
Integration
All integrations intended for the JavaScript scope, particularly Framework Services like Analytics and DeepLing, should be developed exclusively within this layer. For more information, please refer to here.
Publish Plugin
1. Privacy Settings
In the ./plugins/YOUR_PLUGIN_NAME/package.json
file, choose whether the plugin to be published is private by setting the private
field to either true
or false
.
{
"private": true // or "false" depending on your preference
}
2. Plugin Pack
Navigate to the directory ./plugins/YOUR_PLUGIN_NAME/
and pack the plugin in order to publish it on App Maker.
$ appmaker plugin pack --major|--minor|--patch
This command will create a .tgz
file in the ./plugins/YOUR_PLUGIN_NAME/
directory, which contains the plugin's code and metadata. Make sure to specify the version increment you want to apply using --major
, --minor
, or --patch
to follow semantic versioning practices. This will update the version number in the package.json
file accordingly. For more examples on how to use the appmaker plugin pack
command, refer to the Plugin Pack section.
3. Plugin Publish
Next, go to the directory ./plugins/YOUR_PLUGIN_NAME/
and publish the plugin on App Maker using the following command:
$ appmaker plugin publish
Add Plugin
If the user wants to include a plugin that was developed for another project (different from their own), they need to follow these steps:
Clone the Plugin: Clone the plugin's repository into the
.plugins
directory located within the main directory of the current project.Run the
plugin add
Command: After cloning the plugin, use the following command to add the plugin to the current project.
$ appmaker plugin add <name>
Last updated
Was this helpful?