# wx.navigateToMiniProgram(Object object)
Start from base library version 1.3.0. Please remaining backward compatible.
with Promise style call: Supported
Need page permissions: Mini Programs cannot call this interface from a plugin page, and plugins cannot call the interface from the plugins page
Mini Program plugin: Support, need to Mini Program base library version no less than 2.18.1
Open another little program
# parameter
# Object object
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
appId | string | yes | Mini Program to open appId | ||
path | string | no | Open page path, if empty then open the home page. path in The latter part will become Query, in the Mini Programs App.onLaunch 、App.onShow and Page.onLoad Callback function or small game wx.onShow Callback functionwx.getLaunchOptionsSync Can be obtained from query Data. For small games, you can just pass query Part, to achieve the pass parameter effect, such as: pass "foo=bar " 。 | ||
extraData | object | no | Data that needs to be passed to the target Mini Program, which can be found in the App.onLaunch ,App.onShow To get this data in the. If the jump is a small game, you can in wx.onShow、wx.getLaunchOptionsSync This data is available in. | ||
EnvVersion | string | release | no | The version of the Mini Program to open. This parameter is valid only if the current Mini Program is a development or trial version. If the current Mini Program is an official version, the open Mini Program must be the official version. | |
shortLink | string | no | Mini Program link, when passing the parameter, you can not pass appId and path。 Links can be made via [Mini Program menu] ->[Copy link] Get. | 2.18.1 | |
success | function | no | Interface calls the successful callback function | ||
fail | function | no | Interface calls failed callback functions | ||
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.envVersion Legal value
value | Introductions | Minimum version |
---|---|---|
develop | Development version | |
trial | Experience version | |
release | Official version |
# Use restrictions
# Requires user to trigger jump
from 2.3.0 Version of the beginning, if the user did not click on the page of the Mini Program arbitrary position, developers will not be able to call this interface automatically jump to other Mini Program.
# User confirmation required
from 2.3.0 Version, before jumping to other Mini Programs, will be unified to increase pop-up window, ask whether jump, users can jump other Mini Program after confirmation. If the user clicks cancel, the callback fail cancel
。
# No need to declare the jump list, not limited to the number of jump (public test)
- From April 24, 2020, using jump other Mini Program features will not require the declaration of jump lists in the global configuration, and this interface will no longer verify the jump AppID Whether or not navigateToMiniProgramAppIdList In.
- From April 24, 2020, jump other Mini Programs will no longer be limited by the number, please pay attention to the use of this feature to comply with the operating norms.
# Operational Specification
Platform will resolutely fight against the Mini Program box and other mutual promotion, the use of this feature, please strictly observe the"WeChat Mini Program platform operation specifications", if found that the Mini Program violates the operating rules will be removed from the shelf.
# About debugging
- Call this on the developer tools API There is no actual jump to another Mini Program, but the developer tool will verify that the jump was successful.[details](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#Jump Mini Program debugging support)
- Developer tools to support the jump Mini Program handling receive parameters debugging.[details](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#Jump Mini Program debugging support)
# sample code
wx.navigateToMiniProgram({
appId: '',
path: 'page/index/indexid=123',
extraData: {
foo: 'bar'
},
envVersion: 'develop',
success(res) {
// Open success
}
})