diff --git a/uni_modules/uni-memorywarning/changelog.md b/uni_modules/uni-memorywarning/changelog.md
index 0cc5ac21c8107a3d8246b9cd3e42086d174d67a5..7c1cb3d52e524df6c093cee7a97d74f0ad902735 100644
--- a/uni_modules/uni-memorywarning/changelog.md
+++ b/uni_modules/uni-memorywarning/changelog.md
@@ -1,5 +1,4 @@
-## 1.1.0(2022-11-30)
-实现iOS平台内存警告监听
-
+## 1.1.0(2022-12-05)
+实现iOS平台内存警告监听
## 1.0.0(2022-11-12)
实现Android平台内存警告监听功能
diff --git a/uni_modules/uni-memorywarning/package.json b/uni_modules/uni-memorywarning/package.json
index 170bbecf14839d3a3a12395077ef8507705044f3..aa015a936ea73d8161f8d52e97c5bb3da080584c 100644
--- a/uni_modules/uni-memorywarning/package.json
+++ b/uni_modules/uni-memorywarning/package.json
@@ -59,7 +59,9 @@
"app-android": {
"minVersion": "19"
},
- "app-ios": "n"
+ "app-ios": {
+ "minVersion": "9"
+ }
},
"H5-mobile": {
"Safari": "n",
diff --git a/uni_modules/uni-wifi/changelog.md b/uni_modules/uni-wifi/changelog.md
index 2223e605d2f3dba8885bfe1b9cb25692f708cb60..f605ffd3eb943e8b5eed357d788f9bfd369d6991 100644
--- a/uni_modules/uni-wifi/changelog.md
+++ b/uni_modules/uni-wifi/changelog.md
@@ -1,3 +1,3 @@
-## 1.0.0(2022-12-3)
+## 1.0.0(2022-12-5)
实现Android/iOS平台Wi-Fi功能模块
注:iOS平台仅支持获取已连接的 Wi-Fi 信息
diff --git a/uni_modules/uni-wifi/readme.md b/uni_modules/uni-wifi/readme.md
index ee6ede7627b884d4162befb391f79bff06100cba..a594777c4f31c7889cff0a9e405b0461ea2fe675 100644
--- a/uni_modules/uni-wifi/readme.md
+++ b/uni_modules/uni-wifi/readme.md
@@ -12,12 +12,10 @@ Wi-Fi功能模块
- 如果是自定义基座,需要具备下面的权限
```
-
-
-
-
-
-
+
+
+
+
```
@@ -101,9 +99,9 @@ Object object
|属性|类型|默认值|必填|说明|
|---|----|------|----|---|
-|success|function|否|接口调用成功的回调函数|
-|fail|function|否|接口调用失败的回调函数|
-|complete|function|否|接口调用结束的回调函数(调用成功、失败都会执行)|
+|success|function||否|接口调用成功的回调函数|
+|fail|function||否|接口调用失败的回调函数|
+|complete|function||否|接口调用结束的回调函数(调用成功、失败都会执行)|
@@ -132,7 +130,7 @@ Object res
|属性 |类型 |说明 |
|-- |--- |-- |
-|wifiList |Array. |Wi-Fi 列表数据 |
+|wifiList |Array |Wi-Fi 列表数据 |
diff --git a/uni_modules/uni-wifi/utssdk/app-ios/index.uts b/uni_modules/uni-wifi/utssdk/app-ios/index.uts
index 91d35caeea443168d4cdb63f6ff14f285033711f..221a878f7a042c1f6d01e93b45b4b030d36f5398 100644
--- a/uni_modules/uni-wifi/utssdk/app-ios/index.uts
+++ b/uni_modules/uni-wifi/utssdk/app-ios/index.uts
@@ -14,7 +14,7 @@ type WifiOption = {
};
/**
- * Wifi 链接参数封装
+ * Wifi 链接参数封装
*/
type WifiConnectOption = {
SSID: string;
@@ -149,19 +149,30 @@ function fetchConnectedWifiWithLocationPromise(option: GetConnectedWifiOptions)
if (wifiInfo.BSSID.length > 0 && wifiInfo.SSID.length > 0) {
let res = {
+ errSubject: "uni-getConnectedWifi",
errCode: 0,
- errMsg: "getConnectedWifi:success",
+ errMsg: "getConnectedWifi:ok",
wifi: wifiInfo,
}
option.success?.(res)
option.complete?.(res)
}else {
- option.fail?.({errCode: 12000, errMsg: "current wifi is null"})
- option.complete?.({errCode: 12000, errMsg: "current wifi is null"})
+ const res = {
+ errSubject: "uni-getConnectedWifi",
+ errCode: 12010,
+ errMsg: "getConnectedWifi:system internal error"
+ }
+ option.fail?.(res)
+ option.complete?.(res)
}
}else {
- option.fail?.({errCode: 12000, errMsg: "current wifi is null"})
- option.complete?.({errCode: 12000, errMsg: "current wifi is null"})
+ const res = {
+ errSubject: "uni-getConnectedWifi",
+ errCode: 12010,
+ errMsg: "getConnectedWifi:system internal error"
+ }
+ option.fail?.(res)
+ option.complete?.(res)
}
}
@@ -184,8 +195,9 @@ class UniWiFiModuleGloabInfo {
export function startWifi(option: WifiOption) {
UniWiFiModuleGloabInfo.alreadyStartWifi = true
let res = {
+ errSubject: "uni-startWifi",
errCode: 0,
- errMsg: "startWifi: ok"
+ errMsg: "startWifi:ok"
}
option.success?.(res)
option.complete?.(res)
@@ -194,9 +206,16 @@ export function startWifi(option: WifiOption) {
/*
* 停止wifi模块
*/
-export function stopWifi() {
+export function stopWifi(option: WifiOption) {
UniWiFiModuleGloabInfo.alreadyStartWifi = false
LocationPromiseService.promiseCompletionHandler = []
+ let res = {
+ errSubject: "uni-stopWifi",
+ errCode: 0,
+ errMsg: "stopWifi:ok"
+ }
+ option.success?.(res)
+ option.complete?.(res)
}
/*
@@ -204,8 +223,9 @@ export function stopWifi() {
*/
export function getWifiList(option: WifiOption) {
let res = {
+ errSubject: "uni-getWifiList",
errCode: 12001,
- errMsg: "system not support"
+ errMsg: "getWifiList:system not support"
}
option.fail?.(res)
option.complete?.(res)
@@ -230,18 +250,11 @@ export function offGetWifiList(callback: UTSCallback) {
* 获取当前连接的wifi信息
*/
export function getConnectedWifi(option: GetConnectedWifiOptions) {
- let wifiInfo = new UniWifiInfo()
- wifiInfo.SSID = ""
- wifiInfo.BSSID = ""
- wifiInfo.secure = false
- wifiInfo.signalStrength = 0
- wifiInfo.frequency = 0
-
if (UniWiFiModuleGloabInfo.alreadyStartWifi == false) {
let res = {
+ errSubject: "uni-getConnectedWifi",
errCode: 12000,
- errMsg: "getConnectedWifi: not init",
- wifi: wifiInfo
+ errMsg: "getConnectedWifi:not init",
}
option.fail?.(res)
option.complete?.(res)
@@ -252,9 +265,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
fetchConnectedWifiWithLocationPromise(option)
}else {
let res = {
- errCode: 12010,
- errMsg: "have no location promise",
- wifi: wifiInfo
+ errSubject: "uni-getConnectedWifi",
+ errCode: 12007,
+ errMsg: "getConnectedWifi:user denied",
}
option.fail?.(res)
option.complete?.(res)
@@ -271,8 +284,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
*/
export function connectWifi(option: WifiConnectOption) {
let res = {
+ errSubject: "uni-connectWifi",
errCode: 12001,
- errMsg: "system not support"
+ errMsg: "connectWifi:system not support"
}
option.fail?.(res)
option.complete?.(res)
@@ -312,8 +326,9 @@ export function onOffWifiConnectedWithPartialInfo(callback: UTSCallback | null)
*/
export function setWifiList(option: WifiOption) {
let res = {
+ errSubject: "uni-setWifiList",
errCode: 12001,
- errMsg: "system not support"
+ errMsg: "setWifiList:system not support"
}
option.fail?.(res)
option.complete?.(res)