tencent cloud

Feedback

Redirect

Last updated: 2024-03-04 23:10:45

    exitMiniProgram

    This API is used via wx.exitMiniProgram(Object object).
    Feature Description: Terminates the current mini program. A successful invocation necessitates a click action.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    navigateToMiniProgram

    This API is used via wx.navigateToMiniProgram(Object object).
    Feature Description: Launches another mini program.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    appId
    string
    -
    Yes
    The appId of the mini program to be launched.
    path
    string
    -
    No
    Path of the page to be opened. If left blank, the homepage will be opened.
    extraData
    object
    -
    No
    Data to be passed to the target mini program. The target mini program can get this data in App.onLaunch, App.onShow.
    envVersion
    string
    release
    No
    The version of the mini program to be launched. This parameter is only effective when the current mini program is in development or trial version. If the current mini program is in the official version, the mini program to be launched will definitely be the official version. The valid values are as follows:
    develop: Development Version
    trial: Trial Version
    release: Official Version
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    Use limits

    Requires user-initiated redirection

    If the user does not click any location of the mini program page, the developer will be unable to invoke this interface to automatically redirect to another mini program.

    User confirmation required for redirection

    Before redirecting to another mini program, a unified pop-up window will be added, asking whether to redirect. The user can only redirect to another mini program after confirmation. If the user clicks cancel, the callback fail cancel will be triggered.

    Each mini program is limited to redirecting to no more than 10 other mini programs.

    When developers submit a new version of the mini program code, if the function to redirect to other mini programs is used, it is necessary to declare in the code configuration the list of mini programs to which it will redirect, limited to no more than 10. Otherwise, it will not pass the review. This list can be updated when a new version is released and does not support dynamic modification. For configuration methods, see Configuration. When invoking this interface, the appId to which it redirects must be in the configuration list. Otherwise the callback fail appId "${appId}" is not in navigateToMiniProgramAppIdList will be triggered.
    Sample Code
    wx.navigateToMiniProgram({
    appId: '',
    path: 'page/index/index?id=123',
    extraData: {
    foo: 'bar'
    },
    envVersion: 'develop',
    success(res) {
    // Successfully opened
    }
    })

    navigateBackMiniProgram

    The usage method for this API is wx.navigateBackMiniProgram(Object object).
    Feature Description: Returns to the previous mini program. This feature can only be successfully called when the current mini program has been launched by another mini program.
    Parameter and Description: Object
    Attribute
    Type
    Default value
    Required
    Description
    extraData
    Object
    {}
    No
    Data that needs to be returned to the previous mini program can be obtained in the App.onShow.
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Sample Code
    wx.navigateBackMiniProgram({
    extraData: {
    foo: 'bar'
    },
    success(res) {
    // Successful return
    }
    })
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support