When connect with specific wifi using ssid and password in xamarin ios

kefikefi Member ✭✭✭

Error Domain=NEHotspotConfigurationErrorDomain Code=8 "internal error." UserInfo={NSLocalizedDescription=internal error.}

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    What's your code ?

  • kefikefi Member ✭✭✭
    edited July 17
     NEHotspotConfigurationManager wifiManager = new NEHotspotConfigurationManager();
            var wifiConfig = new NEHotspotConfiguration(ssid, password, false) { JoinOnce = true };
    
            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}");
                }
            });
            return true;
    
  • ColeXColeX Member, Xamarin Team Xamurai

    Search with google , the first item is related to it.

    It seems restart the device could fix the issue .
    Refer https://stackoverflow.com/a/47769497/8187800

    If it still happens , try to add the HotSpot Capability to the AppID you are using, also add it in the Xcode Target Capabilities configuration tab and make sure to link the NetworkExtensions.framework.

    You could set it in Entitlements.plist.

    Refer https://stackoverflow.com/a/48950310/8187800

  • kefikefi Member ✭✭✭

    hotspot configuration is enabled in both.

  • ColeXColeX Member, Xamarin Team Xamurai

    Does restart device help or not ?

Sign In or Register to comment.