# Disable Back Button - Android and iOS

{% hint style="info" %}
You'll need to import the javascript file in your website before starting from this [link](https://docs.webtonative.com/javascript-apis/getting-started).
{% endhint %}

{% tabs %}
{% tab title="Plain Javascript" %}

```
window.WTN.customBackHandling({
    enable:true/false
})
```

{% endtab %}

{% tab title="ES5+" %}

```
import { customBackHandling } from "webtonative"

customBackHandling({
    enable:true/false
})
```

{% endtab %}
{% endtabs %}

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(){`\
&#x20;   `//Handle your logic` \
`}`

Feature added in Android on 27/06/25

Feature added in iOS on 04/09/25


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webtonative.com/javascript-apis/disable-back-button-android-and-ios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
