Getting Started: Installation
ENVIRONMENT REQUIREMENT
Node and Package Manager
Environment | Version | Require |
---|---|---|
NodeJS | 14+ | YES |
NPM | 6.14.+ | YES |
Operating System
OS | Support |
---|---|
macOS | YES |
Linux | NO |
Windows | NO |
NPM CONFIGURATION
In the Mini App dashboard, click on Overview in the left Menu, copy NPM Configuration and run it in Terminal.
MINI APP CLI INSTALLATION
To install Mini App CLI, run script below in terminal
npm i @momo-miniapp/cli -g
ANDROID_HOME environment variable
The React Native tools require some environment variables to be set up in order to build apps with native code. Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file.
For more details, see: React Native Installation for Android target OS.
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
COMMAND REFERENCE
Command name | Description | Require login |
---|---|---|
init | Init a new mini app | |
start | Start server metro | |
run-android, run-ios | Run mini app | |
install-android, install-ios | Install momo platform | |
build | Create a build request on Mini App Center | |
login | Login Mini App Center account at terminal | |
link | Login Mini App Center account on browser | |
version | Check Mini App CLI version | |
commands | List Mini App CLI commands |
Create Mini App source code
To create a Mini App with name is myApp, run command below
momo-miniapp init myApp
Replace your Mini App name by myApp
Start Mini App server
If Mini App server isn't running, you can start server again by command below
cd myApp
momo-miniapp start
Start Mini App on Simulators
To Start Mini App on Momo Platform, please ensure you have simulator first (both Android and iOS). If the simulator has installed Momo Platform already then it start immediately, else Momo Platform will be installed on simulator automatically.
/** for Android */
cd myApp
momo-miniapp run-android
/** for iOS */
momo-miniapp run-ios
Start Mini App on Devices
To run Mini App on devices, you have to install Momo Platform in your devices. Connect Android/iOS to Laptop/PC through cable (USB cable, Lightning cable)
Android Installation
/** for Android installation */
cd myApp
momo-miniapp install-android
iOS Installation
brew install libimobiledevice
brew install ideviceinstaller
/** for iOS installation */
cd myApp
momo-miniapp install-ios
Trust Momo Platform Application
Follow steps below to trust Momo Platform application
- Go to Device settings
- Click on Device Management
- Click on ONLINE MOBILE SERVICES JOINT STOCK COMPANY
- Click on Trust Button
Run Mini App
/** for Android */
cd myApp
momo-miniapp run-android
/** for iOS */
momo-miniapp run-ios
Build Mini App
In the Mini App dashboard, click on Overview in left Menu, then click on the Download App JSON and put it into your source folder. See Mini App Structure in Create Mini App documentation.
Note: You need to commit your changes to git repository before building.
Run build command below to build your Mini App
/**
* Build
*/
momo-miniapp build
/**
* With build description
*/
momo-miniapp build "Add Momo payment method"
Login Mini App Center
/**
* Login Mini App Center
*/
momo-miniapp login
Link with Mini App Center account
/**
* Link account
*/
momo-miniapp link
Other commands
Some other commands below
/** check CLI version */
momo-miniapp version
/** view commands instruction */
momo-miniapp commands