Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
bbc5a92f
U
uni-api
项目概览
DCloud
/
uni-api
通知
675
Star
23
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bbc5a92f
编写于
12月 05, 2022
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitcode.net/dcloud/uni-api
into dev
上级
036d461c
a600101b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
38 deletion
+52
-38
uni_modules/uni-memorywarning/changelog.md
uni_modules/uni-memorywarning/changelog.md
+2
-3
uni_modules/uni-memorywarning/package.json
uni_modules/uni-memorywarning/package.json
+3
-1
uni_modules/uni-wifi/changelog.md
uni_modules/uni-wifi/changelog.md
+1
-1
uni_modules/uni-wifi/readme.md
uni_modules/uni-wifi/readme.md
+8
-10
uni_modules/uni-wifi/utssdk/app-ios/index.uts
uni_modules/uni-wifi/utssdk/app-ios/index.uts
+38
-23
未找到文件。
uni_modules/uni-memorywarning/changelog.md
浏览文件 @
bbc5a92f
## 1.1.0(2022-11-30)
## 1.1.0(2022-12-05)
实现iOS平台内存警告监听
实现iOS平台内存警告监听
## 1.0.0(2022-11-12)
## 1.0.0(2022-11-12)
实现Android平台内存警告监听功能
实现Android平台内存警告监听功能
uni_modules/uni-memorywarning/package.json
浏览文件 @
bbc5a92f
...
@@ -59,7 +59,9 @@
...
@@ -59,7 +59,9 @@
"app-android"
:
{
"app-android"
:
{
"minVersion"
:
"19"
"minVersion"
:
"19"
},
},
"app-ios"
:
"n"
"app-ios"
:
{
"minVersion"
:
"9"
}
},
},
"H5-mobile"
:
{
"H5-mobile"
:
{
"Safari"
:
"n"
,
"Safari"
:
"n"
,
...
...
uni_modules/uni-wifi/changelog.md
浏览文件 @
bbc5a92f
## 1.0.0(2022-12-
3
)
## 1.0.0(2022-12-
5
)
实现Android/iOS平台Wi-Fi功能模块
实现Android/iOS平台Wi-Fi功能模块
注:iOS平台仅支持获取已连接的 Wi-Fi 信息
注:iOS平台仅支持获取已连接的 Wi-Fi 信息
uni_modules/uni-wifi/readme.md
浏览文件 @
bbc5a92f
...
@@ -12,12 +12,10 @@ Wi-Fi功能模块
...
@@ -12,12 +12,10 @@ Wi-Fi功能模块
-
如果是自定义基座,需要具备下面的权限
-
如果是自定义基座,需要具备下面的权限
```
```
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
```
```
...
@@ -101,9 +99,9 @@ Object object
...
@@ -101,9 +99,9 @@ Object object
|属性|类型|默认值|必填|说明|
|属性|类型|默认值|必填|说明|
|---|----|------|----|---|
|---|----|------|----|---|
|success|function|否|接口调用成功的回调函数|
|success|function|
|
否|接口调用成功的回调函数|
|fail|function|否|接口调用失败的回调函数|
|fail|function|
|
否|接口调用失败的回调函数|
|complete|function|否|接口调用结束的回调函数(调用成功、失败都会执行)|
|complete|function|
|
否|接口调用结束的回调函数(调用成功、失败都会执行)|
...
@@ -132,7 +130,7 @@ Object res
...
@@ -132,7 +130,7 @@ Object res
|属性 |类型 |说明 |
|属性 |类型 |说明 |
|-- |--- |-- |
|-- |--- |-- |
|wifiList |Array
.
<WifiInfo>
|Wi-Fi 列表数据 |
|wifiList |Array
<WifiInfo>
|Wi-Fi 列表数据 |
...
...
uni_modules/uni-wifi/utssdk/app-ios/index.uts
浏览文件 @
bbc5a92f
...
@@ -14,7 +14,7 @@ type WifiOption = {
...
@@ -14,7 +14,7 @@ type WifiOption = {
};
};
/**
/**
* Wifi 链接参数封装
* Wifi 链接参数封装
*/
*/
type WifiConnectOption = {
type WifiConnectOption = {
SSID: string;
SSID: string;
...
@@ -149,19 +149,30 @@ function fetchConnectedWifiWithLocationPromise(option: GetConnectedWifiOptions)
...
@@ -149,19 +149,30 @@ function fetchConnectedWifiWithLocationPromise(option: GetConnectedWifiOptions)
if (wifiInfo.BSSID.length > 0 && wifiInfo.SSID.length > 0) {
if (wifiInfo.BSSID.length > 0 && wifiInfo.SSID.length > 0) {
let res = {
let res = {
errSubject: "uni-getConnectedWifi",
errCode: 0,
errCode: 0,
errMsg: "getConnectedWifi:
success
",
errMsg: "getConnectedWifi:
ok
",
wifi: wifiInfo,
wifi: wifiInfo,
}
}
option.success?.(res)
option.success?.(res)
option.complete?.(res)
option.complete?.(res)
}else {
}else {
option.fail?.({errCode: 12000, errMsg: "current wifi is null"})
const res = {
option.complete?.({errCode: 12000, errMsg: "current wifi is null"})
errSubject: "uni-getConnectedWifi",
errCode: 12010,
errMsg: "getConnectedWifi:system internal error"
}
option.fail?.(res)
option.complete?.(res)
}
}
}else {
}else {
option.fail?.({errCode: 12000, errMsg: "current wifi is null"})
const res = {
option.complete?.({errCode: 12000, errMsg: "current wifi is null"})
errSubject: "uni-getConnectedWifi",
errCode: 12010,
errMsg: "getConnectedWifi:system internal error"
}
option.fail?.(res)
option.complete?.(res)
}
}
}
}
...
@@ -184,8 +195,9 @@ class UniWiFiModuleGloabInfo {
...
@@ -184,8 +195,9 @@ class UniWiFiModuleGloabInfo {
export function startWifi(option: WifiOption) {
export function startWifi(option: WifiOption) {
UniWiFiModuleGloabInfo.alreadyStartWifi = true
UniWiFiModuleGloabInfo.alreadyStartWifi = true
let res = {
let res = {
errSubject: "uni-startWifi",
errCode: 0,
errCode: 0,
errMsg: "startWifi:
ok"
errMsg: "startWifi:ok"
}
}
option.success?.(res)
option.success?.(res)
option.complete?.(res)
option.complete?.(res)
...
@@ -194,9 +206,16 @@ export function startWifi(option: WifiOption) {
...
@@ -194,9 +206,16 @@ export function startWifi(option: WifiOption) {
/*
/*
* 停止wifi模块
* 停止wifi模块
*/
*/
export function stopWifi() {
export function stopWifi(
option: WifiOption
) {
UniWiFiModuleGloabInfo.alreadyStartWifi = false
UniWiFiModuleGloabInfo.alreadyStartWifi = false
LocationPromiseService.promiseCompletionHandler = []
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() {
...
@@ -204,8 +223,9 @@ export function stopWifi() {
*/
*/
export function getWifiList(option: WifiOption) {
export function getWifiList(option: WifiOption) {
let res = {
let res = {
errSubject: "uni-getWifiList",
errCode: 12001,
errCode: 12001,
errMsg: "system not support"
errMsg: "
getWifiList:
system not support"
}
}
option.fail?.(res)
option.fail?.(res)
option.complete?.(res)
option.complete?.(res)
...
@@ -230,18 +250,11 @@ export function offGetWifiList(callback: UTSCallback) {
...
@@ -230,18 +250,11 @@ export function offGetWifiList(callback: UTSCallback) {
* 获取当前连接的wifi信息
* 获取当前连接的wifi信息
*/
*/
export function getConnectedWifi(option: GetConnectedWifiOptions) {
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) {
if (UniWiFiModuleGloabInfo.alreadyStartWifi == false) {
let res = {
let res = {
errSubject: "uni-getConnectedWifi",
errCode: 12000,
errCode: 12000,
errMsg: "getConnectedWifi: not init",
errMsg: "getConnectedWifi:not init",
wifi: wifiInfo
}
}
option.fail?.(res)
option.fail?.(res)
option.complete?.(res)
option.complete?.(res)
...
@@ -252,9 +265,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
...
@@ -252,9 +265,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
fetchConnectedWifiWithLocationPromise(option)
fetchConnectedWifiWithLocationPromise(option)
}else {
}else {
let res = {
let res = {
err
Code: 12010,
err
Subject: "uni-getConnectedWifi",
err
Msg: "have no location promise",
err
Code: 12007,
wifi: wifiInfo
errMsg: "getConnectedWifi:user denied",
}
}
option.fail?.(res)
option.fail?.(res)
option.complete?.(res)
option.complete?.(res)
...
@@ -271,8 +284,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
...
@@ -271,8 +284,9 @@ export function getConnectedWifi(option: GetConnectedWifiOptions) {
*/
*/
export function connectWifi(option: WifiConnectOption) {
export function connectWifi(option: WifiConnectOption) {
let res = {
let res = {
errSubject: "uni-connectWifi",
errCode: 12001,
errCode: 12001,
errMsg: "system not support"
errMsg: "
connectWifi:
system not support"
}
}
option.fail?.(res)
option.fail?.(res)
option.complete?.(res)
option.complete?.(res)
...
@@ -312,8 +326,9 @@ export function onOffWifiConnectedWithPartialInfo(callback: UTSCallback | null)
...
@@ -312,8 +326,9 @@ export function onOffWifiConnectedWithPartialInfo(callback: UTSCallback | null)
*/
*/
export function setWifiList(option: WifiOption) {
export function setWifiList(option: WifiOption) {
let res = {
let res = {
errSubject: "uni-setWifiList",
errCode: 12001,
errCode: 12001,
errMsg: "system not support"
errMsg: "s
etWifiList:s
ystem not support"
}
}
option.fail?.(res)
option.fail?.(res)
option.complete?.(res)
option.complete?.(res)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录