Disable Back Button API
Disable or customize the back button using the WebToNative JavaScript API. Control app navigation behavior on Android and iOS.
Control the default back button of the phone, blocking the user from going back in the app. For iOS, you can now disable the swipe gesture to go back.
window.WTN.customBackHandling({
enable:true/false
})import { customBackHandling } from "webtonative"
customBackHandling({
enable:true/false
})enable (Boolean parameter) - Passing this true will disable the back button/swipe gesture.
customBackHandling this function on the window will be called where you can handle the back functionality.
Example:-
windows.customBackHandling = function(){
//Handle your logic
}
Feature added in Android on 27/06/25
Feature added in iOS on 04/09/25
Last updated