The Wi-Fi bridge gives the page the current network and its changes, scanning, connecting, known networks, the radio and the hotspot, backed by Shiny.Net.Wifi.
dotnet add package Shiny.AppDeviceBridge.Wifi
builder. UseAppDeviceBridge (
bridge => bridge. AddWifiBridge ( hotspot : false ),
Client
C#
TypeScript
IWifiBridge
AddWifiBridgeClient()
WifiBridge
What works depends on the platform. iOS can’t scan, and Android can’t toggle the radio.
GET /_bridge/wifi lists the platform’s capabilities, and any call it lacks returns 501. Linux
uses NetworkManager through Shiny.Net.Wifi.Linux, which the bridge picks automatically.
wifi.changed and wifi.hotspot only run while a page listens to them. Permissions come from Shiny.Net.Wifi: location on
Android; the Access Wi-Fi Information and Hotspot Configuration entitlements on iOS.
import { WifiBridge } from "@shinyorg/appdevicebridge" ;
const wifi = new WifiBridge ();
await wifi. requestAccess ();
const networks = await wifi. scan ();
networks. sort (( a , b ) => b.signalStrengthPercent - a.signalStrengthPercent);
await wifi. onChanged ( e => console. log ( "now on" , e.current?.ssid ?? "nothing" ));
await wifi. connect ({ ssid: "Shop-Floor" , passphrase, security: "Wpa2Psk" , timeoutMs: 20_000 });
GET /_bridge/ wifiWhat this platform can do, the current network, and whether a hotspot is available. POST /_bridge/ wifi/accessRequests the permission Wi-Fi needs here — location on Android. GET /_bridge/ wifi/networksScans for networks in range. GET /_bridge/ wifi/currentThe network the device is on. POST /_bridge/ wifi/connectionJoins a network by SSID, or a saved one by id. DELETE /_bridge/ wifi/connectionDisconnects from the current network. GET /_bridge/ wifi/knownThe networks saved on the device that this app can see. DELETE /_bridge/ wifi/knownForgets a saved network. GET /_bridge/ wifi/radioWhether the Wi-Fi radio is on. PUT /_bridge/ wifi/radioTurns the Wi-Fi radio on or off. GET /_bridge/ wifi/hotspotWhether a hotspot is supported and running. POST /_bridge/ wifi/hotspotStarts a hotspot. DELETE /_bridge/ wifi/hotspotStops the hotspot. GET /_bridge/ wifi/hotspot/clientsThe devices connected to a hotspot this app started. What this platform can do, the current network, and whether a hotspot is available.
C# IWifiBridge.GetStatusAsyncTS WifiBridge.getStatus
Response 200 WifiStatus WifiStatus · 3 fields capabilitiesWifiCapability []What this platform can do. Calls outside it fail with 501. currentWifiNetworkInfo | null The network the device is on, where the platform can tell. hotspotSupportedboolean Whether the app registered the hotspot and the platform supports one.
POST /_bridge/ wifi/access# Requests the permission Wi-Fi needs here — location on Android.
C# IWifiBridge.RequestAccessAsyncTS WifiBridge.requestAccess
Response 200 WifiAccessResult WifiAccessResult · 1 field GET /_bridge/ wifi/networks# Scans for networks in range.
C# IWifiBridge.ScanAsyncTS WifiBridge.scan
Response 200 WifiScanResult []WifiScanResult · 10 fields ssidstring bssidstring | null securityWifiSecurity signalStrengthDbmnumber | null signalStrengthPercentnumber frequencyMhznumber | null bandWifiBand channelnumber | null isHiddenboolean isOpenboolean
GET /_bridge/ wifi/current# The network the device is on. Null when it is not on Wi-Fi.
C# IWifiBridge.GetCurrentNetworkAsyncTS WifiBridge.getCurrentNetwork
Response 200 WifiNetworkInfo · or 204 when there is none WifiNetworkInfo · 13 fields interfaceNamestring ssidstring | null bssidstring | null securityWifiSecurity ipAddressesstring []dnsAddressesstring []gatewaystring | null subnetMaskstring | null signalStrengthDbmnumber | null signalStrengthPercentnumber | null frequencyMhznumber | null bandWifiBand channelnumber | null
POST /_bridge/ wifi/connection# Joins a network by SSID, or a saved one by id. iOS asks the user first. Fails with 409 when the connection fails, 403 when permission is missing.
C# IWifiBridge.ConnectAsyncTS WifiBridge.connect
Body application/json · WifiConnectRequest WifiConnectRequest · 8 fields ssidstring | null passphrasestring | null securityWifiSecurity bssidstring | null Join this access point in particular. isHiddenboolean rememberboolean Save the network on the device. timeoutMsnumber | null How long to wait for the connection, in milliseconds; the platform's default when null. knownNetworkIdstring | null A saved network's id, instead of an SSID.
Response 200 WifiNetworkInfo WifiNetworkInfo · 13 fields interfaceNamestring ssidstring | null bssidstring | null securityWifiSecurity ipAddressesstring []dnsAddressesstring []gatewaystring | null subnetMaskstring | null signalStrengthDbmnumber | null signalStrengthPercentnumber | null frequencyMhznumber | null bandWifiBand channelnumber | null
Errors 403 Forbidden409 ConflictDELETE /_bridge/ wifi/connection# Disconnects from the current network.
C# IWifiBridge.DisconnectAsyncTS WifiBridge.disconnect
Response 204 No contentThe networks saved on the device that this app can see.
C# IWifiBridge.GetKnownNetworksAsyncTS WifiBridge.getKnownNetworks
Response 200 KnownWifiNetwork []KnownWifiNetwork · 5 fields idstring An int on Android, a UUID on Linux, the SSID itself on Apple platforms. ssidstring securityWifiSecurity isHiddenboolean addedByThisAppboolean
DELETE /_bridge/ wifi/known# Forgets a saved network.
C# IWifiBridge.ForgetAsyncTS WifiBridge.forget
Parameter In Type idquery string required
Response 204 No contentWhether the Wi-Fi radio is on.
C# IWifiBridge.GetRadioAsyncTS WifiBridge.getRadio
Response 200 WifiRadioState WifiRadioState · 1 field Turns the Wi-Fi radio on or off.
C# IWifiBridge.SetRadioAsyncTS WifiBridge.setRadio
Body application/json · WifiRadioState WifiRadioState · 1 field Response 204 No contentGET /_bridge/ wifi/hotspot# Whether a hotspot is supported and running.
C# IWifiBridge.GetHotspotAsyncTS WifiBridge.getHotspot
Response 200 HotspotStatus HotspotStatus · 3 fields supportedboolean Whether the platform supports a hotspot and the app registered it. runningboolean Whether one this app started is running. currentHotspotInfo | null The hotspot, when one is running.
POST /_bridge/ wifi/hotspot# Starts a hotspot. Every field of the request is optional; the platform picks what is not given.
C# IWifiBridge.StartHotspotAsyncTS WifiBridge.startHotspot
Body application/json · HotspotStartRequest HotspotStartRequest · 4 fields ssidstring | null passphrasestring | null bandWifiBand isHiddenboolean
Response 200 HotspotInfo HotspotInfo · 5 fields DELETE /_bridge/ wifi/hotspot# Stops the hotspot.
C# IWifiBridge.StopHotspotAsyncTS WifiBridge.stopHotspot
Response 204 No contentGET /_bridge/ wifi/hotspot/clients# The devices connected to a hotspot this app started. Fails with 409 when it is not running.
C# IWifiBridge.GetHotspotClientsAsyncTS WifiBridge.getHotspotClients
Response 200 HotspotClient []HotspotClient · 3 fields macAddressstring ipAddressstring | null hostNamestring | null
Errors 409 Conflict
The device joined, left or changed networks.
C# IWifiBridge.OnChangedAsyncTS WifiBridge.onChanged
Payload WifiChangedEvent currentWifiNetworkInfo | null The network now; null when the device left Wi-Fi.
The hotspot started, stopped or changed.
C# IWifiBridge.OnHotspotChangedAsyncTS WifiBridge.onHotspotChanged
Payload HotspotChangedEvent currentHotspotInfo | null The hotspot now; null when it stopped.
JSON property names are camelCase and enums travel as their names. A ? marks a property the payload may omit;| null one that may be null.
Wi-Fi on this device.
capabilitiesWifiCapability []What this platform can do. Calls outside it fail with 501. currentWifiNetworkInfo | null The network the device is on, where the platform can tell. hotspotSupportedboolean Whether the app registered the hotspot and the platform supports one.
Something a platform's Wi-Fi can do.
"Scan""Connect""Disconnect""CurrentNetwork""RadioState""RadioToggle""Hotspot""HotspotCustomConfiguration""HotspotClients""KnownNetworks""ForgetNetwork""ConnectKnownNetwork"
The network the device is on.
interfaceNamestring ssidstring | null bssidstring | null securityWifiSecurity ipAddressesstring []dnsAddressesstring []gatewaystring | null subnetMaskstring | null signalStrengthDbmnumber | null signalStrengthPercentnumber | null frequencyMhznumber | null bandWifiBand channelnumber | null
"Unknown""Open""Wep""WpaPsk""Wpa2Psk""Wpa3Psk""Enterprise""Owe""Psk"
"Unknown""TwoPointFourGhz""FiveGhz""SixGhz"
Where a permission stands. Reported by every bridge that needs one; the names match Shiny's own.
"Unknown""NotSupported""NotSetup""Disabled""Restricted""Denied""Available"
A network in range.
ssidstring bssidstring | null securityWifiSecurity signalStrengthDbmnumber | null signalStrengthPercentnumber frequencyMhznumber | null bandWifiBand channelnumber | null isHiddenboolean isOpenboolean
WifiConnectRequestobject # A network to join: by ssid, or a saved one by knownNetworkId.
ssid?string | null passphrase?string | null security?WifiSecurity bssid?string | null Join this access point in particular. isHidden?boolean remember?boolean Save the network on the device. timeoutMs?number | null How long to wait for the connection, in milliseconds; the platform's default when null. knownNetworkId?string | null A saved network's id, instead of an SSID.
A network saved on the device.
idstring An int on Android, a UUID on Linux, the SSID itself on Apple platforms. ssidstring securityWifiSecurity isHiddenboolean addedByThisAppboolean
supportedboolean Whether the platform supports a hotspot and the app registered it. runningboolean Whether one this app started is running. currentHotspotInfo | null The hotspot, when one is running.
A running hotspot.
HotspotStartRequestobject # A hotspot to start. Every field is optional.
ssid?string | null passphrase?string | null band?WifiBand isHidden?boolean
A device connected to the hotspot.
macAddressstring ipAddressstring | null hostNamestring | null
currentWifiNetworkInfo | null The network now; null when the device left Wi-Fi.
HotspotChangedEventobject # currentHotspotInfo | null The hotspot now; null when it stopped.
These routes sit under AppDeviceBridgePolicies.Bridges like every other bridge: callers on this device by default.
See Security .