0

when I try to create a hotspot connection in my Xamarin.IOS project I get the following error returned in the description when using NEHotspotConfigurationManager :

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

I have tried to connect to both the network in the office and my phone's wifi hotspot and both return the same message. I have enabled both the options "Accept WiFi Information" and "Hotspot" on both the App ID on the developer portal and also the same in the Entitlements.plist and still the same error. I'm using the code shown below.

 public async void JoinNetwork()
        {
            NEHotspotConfiguration config = new NEHotspotConfiguration("CTIP");
            config.JoinOnce = false;
            var tcs = new TaskCompletionSource<NSError>();
            NEHotspotConfigurationManager.SharedManager.ApplyConfiguration(config, err => tcs.SetResult(err));
            var error = await tcs.Task;
            if (error != null)
            {
                PAGE.IOSErrorAlert(error.Description, this);
                return;
            }
        }
ColeX
  • 14,062
  • 5
  • 43
  • 240
  • Doesn't the hotspot need password ? I think you need to set password in `NEHotspotConfiguration` constructor . – ColeX May 25 '21 at 02:35

1 Answers1

0

Try you code as below

 NEHotspotConfiguration config = new NEHotspotConfiguration("CTIP" ,passphrase , false);
 config.JoinOnce = true;
 var tcs = new TaskCompletionSource<NSError>();
 NEHotspotConfigurationManager.SharedManager.ApplyConfiguration(config, err => 
 tcs.SetResult(err));

and try to restart your device ,this seems like a known issue on apple side .


Refer to

https://stackoverflow.com/a/47769497/8187800

https://developer.apple.com/forums/thread/107851

ColeX
  • 14,062
  • 5
  • 43
  • 240
  • Thanks for the suggestion but I'm still getting the same after changing the code and restarting the device, I have also tried this on another device to make sure it is not that. – Curtis Thomas May 25 '21 at 08:46
  • Sure, feel free to post here if something updates. – ColeX May 26 '21 at 01:44