Skip to main content

Create Mini App

CREATE MINI APP

Create React Native App

From the Mini App Center dashboard, click on Provider’s name in the left menu (the Provider in the example is Go Company), and click on Mini Apps.

image

Click on the button Add Mini App and fill your Mini App information.

image

Click on the button Add New when your form is completed. Now your Mini App is in the review queue. MoMo will notify the developer when the Mini App is approved.

Create Web App

To create a Web App, follow the same steps as creating React Native App and just change the Type field to WebView.

image

CREATE REACT NATIVE MINI APP

Install Mini App CLI

Read Mini App CLI installation documentation.

Init source code

To init Mini App source code, run the command in the terminal.

/**
* create mini app
* replace myApp by your mini app name
*/
momo-miniapp init myApp

File structure

    myApp
│ scripts
│ app.json
│ babel.config.js
│ index.js
│ metro.config.js
│ package.json
│ startScript.js
│ start.sh
└──src
│ Application.js
└──assets
└──screens
│ Main.js
│ Welcome.js

Structure description

file/ folderDescription
scriptsFolder contains Bundle, Webpack, Common scripts
app.jsonFile contains the Mini App configuration: AppId, name, Install Mode, Deploy Target
babel.config.jsFile contains the Babel configuration
index.jsFile contains root index script
metro.config.jsFile contains the metro configuration
package.jsonFile contains npm packages used in the Mini App
startScript.jsFile contains the Debug QR Code generator
start.shFile contains the start React Native server script
srcFolder contains Mini App screens
Application.jsFile contains the main navigation stack
assetsFolder contains Assets
screensFolder contains Mini App screens
Welcome.jsFile contains sample code
Main.jsFile contains sample code