Debugging
Application development is rather hard and continous process which requires a lot of time and patience. To simplify it, the Telegram Mini Apps platform allows debugging developed application.
Enabling Debug Mode
Telegram Desktop
- Download and launch the Beta Version of Telegram Desktop.
- Open the side menu and navigate to
Settings > Advanced
. - Scroll down the opened menu and click the
Experimental settings
button. - Check the
Enable webview inspecting
option.
When the debug mode is enabled, right-clicking in the Mini App will display a context menu with the Inspect
option, allowing you to open developer tools.
Telegram for macOS
- Download and launch the Beta Version of Telegram macOS.
- Quickly click 5 times on the Settings icon to open the Debug Menu and enable
Debug Mini Apps
option.
As well as in Telegram Desktop, Inspect Element
option will appear in the context menu.
Telegram for Android
- Enable USB-Debugging on your device.
- In Telegram Settings, scroll all the way down, press and hold on the version number two times.
- Choose
Enable WebView Debug
in the Debug Settings. - Connect your phone to your computer and open
chrome://inspect/#devices
in Chrome – you will see your Mini App there when you launch it on your phone.
Telegram for iOS
Currently, the Telegram for iOS application doesn't have a built-in way to debug the application. Nevertheless, to access debugging features, refer to the Eruda section.
Eruda
Eruda is a technology that provides a lightweight console in the web. We typically use such packages in environments that don't offer their own consoles.
Currently, Telegram for iOS doesn't provide a common way to debug the Mini App. Eruda appears to be a good solution to this problem.
First of all, it is necessary to install the package and initialize it.
<script src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init()</script>
import eruda from 'eruda';
eruda.init();
After eruda is initialized, you will see its element in the UI. Clicking on it will display the console.