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.
Click on the button Add Mini App and fill your Mini App information.
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.
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/ folder | Description |
---|---|
scripts | Folder contains Bundle, Webpack, Common scripts |
app.json | File contains the Mini App configuration: AppId, name, Install Mode, Deploy Target |
babel.config.js | File contains the Babel configuration |
index.js | File contains root index script |
metro.config.js | File contains the metro configuration |
package.json | File contains npm packages used in the Mini App |
startScript.js | File contains the Debug QR Code generator |
start.sh | File contains the start React Native server script |
src | Folder contains Mini App screens |
Application.js | File contains the main navigation stack |
assets | Folder contains Assets |
screens | Folder contains Mini App screens |
Welcome.js | File contains sample code |
Main.js | File contains sample code |