当我尝试在我的Xamarin.IOS项目中创建热点连接时,在使用NEHotspotConfigurationManager时,在描述中返回以下错误:
Error Domain=NEHotspotConfigurationErrorDomain Code=8 \"internal error.\" UserInfo={NSLocalizedDescription=internal error.}
我试着同时连接到办公室的网络和手机的wifi热点,但两者都返回了相同的信息。我已经在开发人员门户上的应用程序ID上启用了“接受WiFi信息”和“热点”选项,在Entitlements.plist中也是如此,但仍然存在相同的错误。我正在使用下面显示的代码。
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;
}
}发布于 2021-05-25 10:38:46
尝试如下所示的代码
NEHotspotConfiguration config = new NEHotspotConfiguration("CTIP" ,passphrase , false);
config.JoinOnce = true;
var tcs = new TaskCompletionSource<NSError>();
NEHotspotConfigurationManager.SharedManager.ApplyConfiguration(config, err =>
tcs.SetResult(err));尝试重启你的设备,这似乎是苹果方面的一个已知问题。
请参阅
https://stackoverflow.com/questions/67673471
复制相似问题