All Products
Search
Document Center

Realize multiple instantiation of Android mini program

Last Updated: Jun 03, 2021

When receiving the push message, click on the notification bar to jump to the opened mini program page, and click the back button to the previous mini program page. When multiple instances are started by the mini program with the same AppId, you only need to pass different parameters.

Procedure

  1. Configure the property of h5_tiny_multiApp for assets.
    Set the h5_tiny_multiApp property in custom_config.json under the assets folder.
       
    1. [
    2. {
    3. "value": "NO",
    4. "key": "h5_tiny_multiApp"
    5. }
    6. ]
  2. Configure startup parameter.
    You need to set appClearTop and startMultApp for mini program startup, the configuration is as follows:
       
    1. Bundle param = new Bundle();
    2. // multiple instances of the applet can be started after setting these two properties.
    3. param.putBoolean("appClearTop", false);
    4. param.putString("startMultApp", "YES");
    5. MPNebula.startApp("2021042820210428",param);