79515850

Date: 2025-03-17 22:10:44
Score: 1
Natty:
Report link

To achive full screen, I used a library called @telegram-apps/sdk

npm install @telegram-apps/sdk

Then I wrote this code in App component it loads when App component loades:

useEffect(() => {
    async function initTg() {
      if (await isTMA()) {
        init();

        if (viewport.mount.isAvailable()) {
          await viewport.mount();
          viewport.expand();
        }

        if (viewport.requestFullscreen.isAvailable()) {
          await viewport.requestFullscreen();
        }
      }
    }
    initTg();

  }, []);

Here is the result:
enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Abdulkhak Tursunov