This API is called using wx.exitMiniProgram(Object object).
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.navigateToMiniProgram(Object object).
Property | Type | Default value | Required | Description |
appId | string | - | True | The appId of the mini program to open. |
path | string | - | False | The page path to open. If empty, the home page is opened. The string after the ? in the path will become a query, and the query data can be obtained in the mini program’s callback functions App.onLaunch, App.onShow and Page.onLoad, or in wx.getLaunchOptionsSync. |
extraData | object | - | False | Data to pass to the target mini program. It can be obtained in App.onLaunch and App.onShow . |
envVersion | string | release | False | The version of the mini program to open. This parameter is valid only when the current mini program is in development version or Preview. If the current mini program is the released version, the mini program that is opened must be the released version. Valid values: develop: The development version trial: The Preview release: The released version |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
fail cancel
.fail appId "${appId}" is not in navigateToMiniProgramAppIdList
.wx.navigateToMiniProgram({appId: '',path: 'page/index/index?id=123',extraData: {foo: 'bar'},envVersion: 'develop',success(res) {// Navigation to mini program successful}})
This API is called using wx.navigateBackMiniProgram(Object object).
Property | Type | Default value | Required | Description |
extraData | Object | {} | False | Data to return to the previous mini program. The previous mini program can access this data in App.onShow. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
wx.navigateBackMiniProgram({extraData: {foo: 'bar'},success(res) {// Returned to previous mini program successfully}})