fixed ios wifi part support. retry 1.
This commit is contained in:
1 parent
faa51215f3
commit
521c14b2fc
4 files changed
+7
-3
No files matched your search
@@ -103,7 +103,7 @@ WiFi options:
|
||||
- `ssid`:必填
|
||||
- `password`:开放网络可省略
|
||||
- `security`:`open`、`wep`、`wpa2`、`wpa3`,默认按是否存在 password 推断为 `open` 或 `wpa2`
|
||||
- `hiddenSsid`:可选,Android 支持隐藏 SSID;iOS 当前实现忽略该字段
|
||||
- `hiddenSsid`:可选;Android 支持隐藏 SSID;iOS 13+ 会设置 `NEHotspotConfiguration.hidden`
|
||||
- `bssid`:可选,仅 Android 10+ 临时连接使用
|
||||
- `joinOnce`:可选,仅 iOS;`connectWifi` 默认 `true`,`saveWifi` 默认 `false`
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bluememe-utils",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Cordova utilities for WiFi, Firebase Cloud Messaging, and biometric unlock for OutSystems 11 apps.",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
id="bluememe-utils"
|
||||
version="0.1.0">
|
||||
version="0.1.1">
|
||||
<name>bluememe-utils</name>
|
||||
<description>Cordova utilities for WiFi, Firebase Cloud Messaging, and biometric unlock.</description>
|
||||
<license>MIT</license>
|
||||
|
||||
@@ -288,6 +288,7 @@ static NSString * const BluememeDeviceKeyDefaultsKey = @"bluememe_utils_device_k
|
||||
NSString *security = [[self stringFromDictionary:options key:@"security"] lowercaseString];
|
||||
BOOL isWep = [security isEqualToString:@"wep"] || [self boolFromDictionary:options key:@"isWep" defaultValue:NO];
|
||||
BOOL joinOnce = [self boolFromDictionary:options key:@"joinOnce" defaultValue:defaultJoinOnce];
|
||||
BOOL hiddenSsid = [self boolFromDictionary:options key:@"hiddenSsid" defaultValue:NO];
|
||||
|
||||
if (ssid.length == 0) {
|
||||
[self sendErrorForCommand:command code:@"INVALID_WIFI_OPTIONS" message:@"ssid is required."];
|
||||
@@ -308,6 +309,9 @@ static NSString * const BluememeDeviceKeyDefaultsKey = @"bluememe_utils_device_k
|
||||
} else {
|
||||
configuration = [[NEHotspotConfiguration alloc] initWithSSID:ssid passphrase:password isWEP:isWep];
|
||||
}
|
||||
if (@available(iOS 13.0, *)) {
|
||||
configuration.hidden = hiddenSsid;
|
||||
}
|
||||
configuration.joinOnce = joinOnce;
|
||||
|
||||
[[NEHotspotConfigurationManager sharedManager] applyConfiguration:configuration completionHandler:^(NSError *error) {
|
||||
|
||||
Reference in new issue
Block a user