HomeDocs
Skip to main content

dlt.backExitInterceptor

Introduction

The exit interceptor capability allows you to intercept the exit event when the user attempts to exit the mini-program by clicking the back button.

Note: The interceptor takes effect after being in the mini-program for more than 10 seconds. It can be triggered up to 5 times a day, with each trigger requiring an interval of at least 60 seconds.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function that is called when the exit event is intercepted successfully.
failfunctionNoCallback function that is called when the interface call fails.
completefunctionNoCallback function that is called when the interface call is complete, whether it succeeds or fails.

Sample Code

Page({
onLoad() {
dlt.backExitInterceptor({
success: function (res) {
// Intercepted the exit or back event
},
fail: function (res) {
// Failed to intercept
},
complete: function (res) {},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.