Share via


WiFiOnDemandHotspotConnectTriggerDetails.ConnectAsync Method

Definition

Important

Location consent is now required for Wi-Fi BSSID access. For details on how this affects apps using Wi-Fi or location APIs, see Changes to API behavior for Wi-Fi access and location.

Asynchronously notifies the operating system (OS) connection flow to connect to the given hotspot network (a specific SSID/password).

Note

If you want to use this API in a UWP app, and publish your app to the Microsoft Store, then you'll need to request special approval to use the custom capability Microsoft.onDemandHotspotControl_8wekyb3d8bbwe (the On-Demand Network capability). For more info, see Custom capabilities.

The On-Demand Network capability will be made available only to app developers building end-to-end Wi-Fi hotspot scenarios between a tethering-capable hardware device and a Windows PC.

public:
 virtual IAsyncOperation<WiFiOnDemandHotspotConnectionResult ^> ^ ConnectAsync() = ConnectAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<WiFiOnDemandHotspotConnectionResult> ConnectAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<WiFiOnDemandHotspotConnectionResult> ConnectAsync();
function connectAsync()
Public Function ConnectAsync () As IAsyncOperation(Of WiFiOnDemandHotspotConnectionResult)

Returns

An asynchronous operation object which, when it completes, contains the result of the connection.

Attributes

Windows requirements

Requirements Description
App capabilities
onDemandHotspotControl

Remarks

Internally, should the app fail to call this method, the connection flow will time out once the background task process has been ended.

Applies to