Pebble.Companion.Connectivity

Phone internet connectivity exposed by the companion bridge.

This reports whether the phone companion runtime considers itself online. It does not describe watch-to-phone Bluetooth connection — use Pebble.System.connectionStatus on the watch for that.

init _ =
    ( model, Connectivity.current ConnectivityChanged )

subscriptions _ =
    Connectivity.onConnectivity ConnectivityChanged

Types

Connectivity

type Connectivity
    = Online
    | Offline

Phone connectivity state reported by the companion bridge.

Commands

current

current : (Connectivity -> msg) -> Cmd msg

Request the current phone connectivity state.

setup

setup : Cmd msg

Register this platform handler with the companion bridge.

Subscriptions

onConnectivity

onConnectivity : (Connectivity -> msg) -> Sub msg

Receive pushed connectivity updates from the companion bridge.

Registering this subscription also tells the bridge to send connectivity updates.