gem.bot/howto

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

  1. Full screen: add &mode=fullscreen to the link or call requestFullscreen. lockOrientation keeps the current orientation.
  2. Location: LocationManager.init, then getLocation. If the person says no, you get nothing.
  3. Motion: start Accelerometer, DeviceOrientation (with need_absolute for compass data) or Gyroscope with a refresh_rate.
  4. Biometrics: BiometricManager.init, then requestAccess and authenticate, each with a short reason.
  5. Helpers: HapticFeedback, showScanQrPopup, and CloudStorage, DeviceStorage or SecureStorage to remember things.
  6. Check that the person's Telegram has the feature: full screen, location and motion need isVersionAtLeast('8.0').

Watch out

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

Open in Telegram