Is possible connect to a specified WIFI in iOS?

I have a SSID and password for a WI-FI and i try to connect it automatically. I have found the solution for Android, but have anyone same solution for iOS?

Answers

  • I have same question, as per apple documentation ios 11 support to connect specific wifi with SSID and password.

    Is it possible from Xamarin form or Xamarin IOS to connect wifi with SSID and pssword?

  • diegoxleondiegoxleon ESMember ✭✭
    edited January 2

    Yes, you can connect to WPA networks with iOS 11 in 3 simple lines.

        public async Task<bool> ConnectWpa(string ssid, string password)
                {
                    try
                    {
                        var config = new NEHotspotConfiguration(ssid, password, false) {JoinOnce = true};
                        var configManager = new NEHotspotConfigurationManager();
                        await configManager.ApplyConfigurationAsync(config);
    
                        this.Log().Debug("Connected!!!!!");
    
                        return true;
                    }
                    catch (Foundation.NSErrorException error)
                    {
                        this.Log().Error(error.Message);
                        return false;
                    }
                    catch (Exception e)
                    {
                        this.Log().Exception(e);
                        return false;
                    }
                }
    
Sign In or Register to comment.