Network
Public surface (network): getStatus
type NetworkConnectionType = 'wifi' | 'cellular' | 'wired' | 'none'
interface NetworkStatus { connected: boolean type: NetworkConnectionType}Get status
Section titled “Get status”getStatus(): Promise<NetworkStatus>import mobilelocker from '@mobilelocker/javascript-sdk'
const { connected, type } = await mobilelocker.network.getStatus()if (!connected) { // show offline banner}| Environment | Behavior |
|---|---|
Native app (isApp()) |
Host GET …/network/status (accurate connection type) |
| Browser / CDN | navigator.onLine — approximate; may report online on captive portals. Type is 'wifi' when connected else 'none' |
API reference
Section titled “API reference”- Module:
network - Types:
NetworkStatus,NetworkConnectionType