Skip to main content

Getting Started: Installation

ENVIRONMENT REQUIREMENT

Node and Package Manager

EnvironmentVersionRequire
NodeJS14+YES
NPM6.14.+YES

Operating System

OSSupport
macOSYES
LinuxNO
WindowsNO

NPM CONFIGURATION

In the Mini App dashboard, click on Overview in the left Menu, copy NPM Configuration and run it in Terminal.

image

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 nameDescriptionRequire login
initInit a new mini app
startStart server metro
run-android, run-iosRun mini app
install-android, install-iosInstall momo platform
buildCreate a build request on Mini App Center
loginLogin Mini App Center account at terminal
linkLogin Mini App Center account on browser
versionCheck Mini App CLI version
commandsList 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.

image

Run build command below to build your Mini App

/**
* Build
*/

momo-miniapp build

/**
* With build description
*/
momo-miniapp build "Add Momo payment method"

image

Login Mini App Center

/**
* Login Mini App Center
*/
momo-miniapp login

login-command

/**
* Link account
*/
momo-miniapp link

link-authorize

link-success

Other commands

Some other commands below

/** check CLI version */
momo-miniapp version

/** view commands instruction */
momo-miniapp commands