Users can accidentally tap the close button in the upper-left corner of a Telegram Web App. The confirmation behavior is configured in the Mini App’s frontend, not in the bot.
Load the Telegram Web App SDK:
1 | <script src="https://telegram.org/js/telegram-web-app.js"></script> |
Telegram will then display a confirmation sheet when the user tries to close the app.
