Detect the platform
Detect whether your scene is running on mobile, desktop, or web.
Available functions
import { getPlatform, isMobile, isDesktop, isWeb } from '@dcl/sdk/platform'import { engine } from '@dcl/sdk/ecs'
import { getPlatform } from '@dcl/sdk/platform'
function platformCheckSystem() {
if (getPlatform() === null) return
engine.removeSystem(platformCheckSystem)
setupUI()
}
engine.addSystem(platformCheckSystem)Branch your UI by platform
Checking the raw platform value
Related
Last updated