1

I am implementing an app through Xamarin.

Is it possible to programmatically connect to an SSID which is already remembered by the phone in iOS?

4

1 回答 1

0

No, it is not possible to connect to a known network, without providing the necessary credentials, due to various security reasons.

In order to connect to a network, you need to create a NEHotspotConfiguration

The class requires either only SSID (for open networks), or SSID with some credentials for authentication.

After the configuration is created, you can connect via NEHotspotConfigurationManager like so:

await NEHotspotConfigurationManager.SharedManager.ApplyConfigurationAsync(config);

NB: Keep in mind that to connect to a network, you need to enable the Hotspot capability in your App Capabilities Working with capabilities.

于 2020-05-02T13:43:25.290 回答