# Navigation
# navigateToMiniProgram
Supported since Base Library 1.3.9, iOS SDK 2.1.23, Android SDK 2.1.38
navigateToMiniProgram(Object object)
Opens another Mini-Program.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| appId | string | Yes | The appId of the Mini-Program to open | |
| path | string | No | The page path to open; opens the homepage if left empty. The part after ? in the path becomes the query, which can be obtained in the callback functions App.onLaunch, App.onShow, and Page.onLoad for Mini-Programs, or ft.onShow callback function and ft.getLaunchOptionsSync for Mini-Games. For Mini-Games, only the query part can be passed to achieve parameter passing, e.g., pass "?foo=bar". | |
| extraData | Object | No | Data to be passed to the target Mini-Program, which can be obtained in App.onLaunch and App.onShow of the target Mini-Program. If navigating to a Mini-Game, this data can be obtained in ft.onShow and ft.getLaunchOptionsSync. | |
| success | function | No | Callback function for successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function for API call completion (executes regardless of success or failure) |
Example
ft.navigateToMiniProgram({
appId: '',
path: 'page/index/index?id=123',
extraData: {
foo: 'bar'
},
success(res) {
// Opened successfully
}
})
# navigateToWechatMiniProgram
Supported since Base Library 3.0.42, iOS SDK 2.40.7, Android SDK 2.40.7
navigateToWechatMiniProgram(Object object)
Navigates to open a WeChat Mini-Program.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| originId | string | Yes | Original ID | |
| path | string | No | The page path to open; opens the homepage if left empty. The part after ? in the path becomes the query, which can be obtained in the callback functions App.onLaunch, App.onShow, and Page.onLoad for Mini-Programs, or ft.onShow callback function and ft.getLaunchOptionsSync for Mini-Games. For Mini-Games, only the query part can be passed to achieve parameter passing, e.g., pass "?foo=bar". | |
| envVersion | String | release | No | The version of the Mini-Program to open. This parameter is only effective when the current Mini-Program is a development version or trial version. If the current Mini-Program is a release version, the opened Mini-Program will definitely be a release version. |
| success | function | No | Callback function for successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function for API call completion (executes regardless of success or failure) |
Valid values for object.envVersion
| Value | Description | Minimum Version |
|---|---|---|
| develop | Development Version | |
| trial | Trial Version | |
| release | Release Version |
Example
ft.navigateToWechatMiniProgram({
originId: '',
path: 'page/index/index?id=123'
})
# navigateBackMiniProgram
Supported since Base Library 1.3.9, iOS SDK 2.1.23, Android SDK 2.1.38
navigateBackMiniProgram(Object object)
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| extraData | Object | No | Data to be returned to the previous Mini-Program, which can be obtained in App.onShow of the previous Mini-Program. | |
| success | function | No | Callback function for successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function for API call completion (executes regardless of success or failure) |
Example Code
ft.navigateBackMiniProgram({
extraData: {
foo: 'bar'
},
success(res) {
// Returned successfully
}
})
# exitMiniProgram
ft.exitMiniProgram(Object object)
Exits the current Mini-Program.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| success | function | No | Callback function for successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function for API call completion (executes regardless of success or failure) |
# restartMiniProgram
ft.restartMiniProgram(Object object)
Restarts the Mini-Program.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| path | string | Yes | The page path to open; query parameters can be added. | |
| success | function | No | Callback function for successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function for API call completion (executes regardless of success or failure) |