Full screen and device features
What it is
A Mini App can take the whole screen, in portrait or landscape, and use the phone itself: location, motion sensors, fingerprint or face. Smaller helpers include haptic feedback, a QR scanner and storage. Location and biometrics work only after the person allows them in Telegram's own window.
How to do it
- Full screen: add `&mode=fullscreen` to the link or call `requestFullscreen`.… Full screen: add `&mode=fullscreen` to the link or call `requestFullscreen`. `lockOrientation` keeps the current orientation.
- Location: `LocationManager.init`, then `getLocation`. If the person says no, you get nothing.
- Motion: start `Accelerometer`, `DeviceOrientation` (with `need_absolute` for… Motion: start `Accelerometer`, `DeviceOrientation` (with `need_absolute` for compass data) or `Gyroscope` with a `refresh_rate`.
- Biometrics: `BiometricManager.init`, then `requestAccess` and `authenticate`, each with a short reason.
- Helpers: `HapticFeedback`, `showScanQrPopup`, and `CloudStorage`, `DeviceStorage` or `SecureStorage` to remember things.
- Check that the person's Telegram has the feature: full screen, location and motion need `isVersionAtLeast('8.0')`.
Watch out
- Full screen can fail with `UNSUPPORTED`, and its header is transparent: keep buttons inside `safeAreaInset` and `contentSafeAreaInset`.
- `refresh_rate` is 20 to 1000 ms (default 1000), and not every device keeps it.
- A biometric reason is up to 128 characters.
- After a refusal, `openSettings` can lead the person to the settings, but only from a tap inside your app.
- Storage per person: `CloudStorage` 1024 items of up to 4096 characters, `DeviceStorage` 5 MB, `SecureStorage` 10 items.
With Gem
Gem doesn't switch projects to full screen or use location, motion or biometrics today. Nearby: /newapp in @gembot builds a small Mini App from your description that runs in Gem's sandbox with its own link.
Sources
- https://core.telegram.org/bots/webapps#initializing-mini-apps
- https://core.telegram.org/api/links#direct-mini-app-links
- https://telegram.org/blog/fullscreen-miniapps-and-more