在Xamarin iOS中连接wifi时出现错误

时间:2019-07-15 05:51:55

标签: xamarin.ios

我想在xamarin ios中连接wifi并收到此错误:

  

错误域= NEHotspotConfigurationErrorDomain代码= 8“内部   错误。“ UserInfo = {NSLocalizedDescription =内部错误。}

var wifiManager = new NEHotspotConfigurationManager();
            var wifiConfig = new NEHotspotConfiguration(ssid, password, false);
            wifiConfig.JoinOnce = false;
            wifiManager.RemoveConfiguration(ssid);
            wifiManager.ApplyConfigurationAsync(wifiConfig);
            wifiManager.ApplyConfiguration(wifiConfig, (error) =>
            {
               if (error != null)
               {
                   Console.WriteLine(error.GetType());
                  Console.WriteLine($"Error while connecting to WiFi network {ssid}: {error.LocalizedDescription}");
                 Console.WriteLine($"Error while connecting to WiFi network {ssid}: {error.Description}");

                           }
                      });

}

0 个答案:

没有答案