我有一个针对iOS开发的React Native应用。我需要使用NEHotspotConfiguration
和NEHotspotConfigurationManager
软件包。
我有如下代码,仅尝试连接到本地网络上的SSID;
let configuration = NEHotspotConfiguration.init(ssid: "mySSIDIsHere", passphrase: "myPassphraseIsHere", isWEP:
false)
// configuration.joinOnce = false
NEHotspotConfigurationManager.shared.apply(configuration) { (error) in
if error != nil {
if error?.localizedDescription == "already associated."
{
print("Connected")
}
else{
print("No Connected")
}
}
else {
print("Connected")
}
这是另一个应该起作用的问题的例子。但出现以下错误;
NEHotspotConfigurationHelper failed to communicate to helper server
请注意,我不是在使用物理设备,而是在使用模拟器。有人可以确认这是问题吗?在研究过程中,我碰到过帖子/博客等,但是有些人说这必须是一种物理设备,而其他人则说这是我的权利。
我有一个苹果开发者帐户(99美元),我的应用程序是使用包ID和what进行注册的,并启用了网络扩展,热点配置和访问wifi信息授权,并在“签名”选项下的xCode中启用了功能(如下所示)
对此有任何帮助。