Ios joinOnce在NehospotConfiguration中做什么?
我正在尝试用下面的代码在iOS中进行自动连接Ios joinOnce在NehospotConfiguration中做什么?,ios,iphone,networking,Ios,Iphone,Networking,我正在尝试用下面的代码在iOS中进行自动连接 if([Utils isEmpty:password]){ configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID]; }else{ configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID passphrase: password isWEP: NO]; } configu
if([Utils isEmpty:password]){
configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID];
}else{
configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID passphrase: password isWEP: NO];
}
configuration.joinOnce = YES;
/* Alert the OS that the user wants to connect to the WiFi */
[[NEHotspotConfigurationManager sharedManager] applyConfiguration: configuration completionHandler: ^ (NSError * _Nullable error) {
if (nil == error) {
DLog (@ "Is Connected!!");
[WiFiManager sendCallback:CONNECTED callback:callback];
} else {
DLog (@ "Error is:%@", error);
[WiFiManager sendCallback:UNKNOWN callback:callback];
}}];
这里我有一次=是的。
当设置为“否”时,它实际上做了什么。
我觉得“是”和“否”没有什么区别
任何人请解释。当
joinOnce
设置为true
时,这意味着一旦设备休眠或应用程序在后台运行一段时间,与热点的连接就会断开,配置就会被忘记。似乎很清楚这是否意味着如果joinOnce设置为false,当应用程序被关闭或处于后台时,wifi不会断开连接?这是正确的。@Paulw11..谢谢。)joinOnce
是否有默认值?如果我根本懒得设置joinOnce
,该怎么办?