Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
6c36de1e
U
uni-api
项目概览
DCloud
/
uni-api
通知
677
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看板
提交
6c36de1e
编写于
3月 16, 2023
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: uni-usercapturescreen iOS 更新
上级
47afda52
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
76 addition
and
144 deletion
+76
-144
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
+8
-24
uni_modules/uni-usercapturescreen/utssdk/interface.uts
uni_modules/uni-usercapturescreen/utssdk/interface.uts
+1
-11
uni_modules/uni-wifi/utssdk/app-ios/index.uts
uni_modules/uni-wifi/utssdk/app-ios/index.uts
+67
-18
uni_modules/uni-wifi/utssdk/interface.uts
uni_modules/uni-wifi/utssdk/interface.uts
+0
-91
未找到文件。
uni_modules/uni-usercapturescreen/utssdk/app-ios/index.uts
浏览文件 @
6c36de1e
...
...
@@ -3,7 +3,7 @@ import { CGRect } from "CoreFoundation";
import { UIApplication, UIView, UITextField, UIScreen, UIDevice } from "UIKit"
import { UTSiOS } from "DCloudUTSFoundation"
import { DispatchQueue } from 'Dispatch';
import { SetUserCaptureScreenOptions,
UserCaptureScreenResult, OnUserCaptureScreen, OffUserCaptureScreen, SetUserCaptureScreen, UserCaptureScreenCallback, OnUserCaptureScreenResult
} from "../interface.uts"
import { SetUserCaptureScreenOptions,
OnUserCaptureScreenCallbackResult, OnUserCaptureScreen, OffUserCaptureScreen, SetUserCaptureScreen, UserCaptureScreenCallback, OnUserCaptureScreenResult, SetUserCaptureScreenSuccess, SetUserCaptureScreenFail
} from "../interface.uts"
/**
* 定义监听截屏事件工具类
...
...
@@ -26,11 +26,8 @@ class CaptureScreenTool {
// target-action 的方法前需要添加 @objc 前缀
@objc static userDidTakeScreenshot() {
// 回调
const res: OnUserCaptureScreenResult = {
errCode: 0,
errSubject: "uni-usercapturescreen",
errMsg: "onUserCaptureScreen: ok",
path: null
const res: OnUserCaptureScreenCallbackResult = {
}
this.listener?.(res)
}
...
...
@@ -39,13 +36,6 @@ class CaptureScreenTool {
static removeListen(callback : UserCaptureScreenCallback | null) {
this.listener = null
NotificationCenter.default.removeObserver(this)
const res: OnUserCaptureScreenResult = {
errCode: 0,
errSubject: "uni-usercapturescreen",
errMsg: "offUserCaptureScreen: ok",
path: null
}
callback?.(res)
}
static createSecureView() : UIView | null {
...
...
@@ -81,10 +71,7 @@ class CaptureScreenTool {
rootView!.frame = rect
}
}
let res: UserCaptureScreenResult = {
errCode: 0,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:ok"
let res: SetUserCaptureScreenSuccess = {
}
option.success?.(res)
option.complete?.(res)
...
...
@@ -106,10 +93,7 @@ class CaptureScreenTool {
}
this.secureView = null
}
let res: UserCaptureScreenResult = {
errCode: 0,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:ok"
let res: SetUserCaptureScreenSuccess = {
}
option.success?.(res)
option.complete?.(res)
...
...
@@ -136,7 +120,7 @@ export const offUserCaptureScreen : OffUserCaptureScreen = function (callback :
*/
export const setUserCaptureScreen : SetUserCaptureScreen = function (options : SetUserCaptureScreenOptions) {
if (UIDevice.current.systemVersion < "13.0") {
let res:
UserCaptureScreenResult
= {
let res:
SetUserCaptureScreenFail
= {
errCode: 12001,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:system not support"
...
...
@@ -145,7 +129,7 @@ export const setUserCaptureScreen : SetUserCaptureScreen = function (options : S
options.complete?.(res);
} else if (UIDevice.current.systemVersion == "15.1") {
let res:
UserCaptureScreenResult
= {
let res:
SetUserCaptureScreenFail
= {
errCode: 12010,
errSubject: "uni-usercapturescreen",
errMsg: "setUserCaptureScreen:system internal error"
...
...
uni_modules/uni-usercapturescreen/utssdk/interface.uts
浏览文件 @
6c36de1e
export type OnUserCaptureScreenCallbackResult = {
/**
* 错误码
* 0:成功
* -1:permission denied(仅Android返回)
*/
errCode ?: number,
/**
* 错误的详细信息
*/
errMsg ?: string,
/**
* 截屏文件路径(仅Android返回)
*/
...
...
@@ -19,7 +9,7 @@ export type OnUserCaptureScreenCallbackResult = {
/**
* uni.onUserCaptureScreen/uni.offUserCaptureScreen回调函数定义
*/
export type UserCaptureScreenCallback = (res : OnUserCaptureScreenResult) => void
export type UserCaptureScreenCallback = (res : OnUserCaptureScreen
Callback
Result) => void
/**
...
...
uni_modules/uni-wifi/utssdk/app-ios/index.uts
浏览文件 @
6c36de1e
...
...
@@ -3,8 +3,59 @@ import { CaptiveNetwork, kCNNetworkInfoKeySSID, kCNNetworkInfoKeyBSSID } from 'S
import { NSArray, NSDictionary } from 'Foundation';
import { CFString } from 'CoreFoundation';
import { UIDevice } from 'UIKit';
import { UniWifiResult, GetConnectedWifiOptions, WifiConnectOption, WifiOption, UniWifiInfo, UniWifiCallback, StartWifi, StopWifi, GetWifiList, GetConnectedWifi, OnGetWifiList, OnWifiConnectedWithPartialInfo, OnOffWifiConnectedWithPartialInfo, OnWifiConnected, ConnectWifi, OffGetWifiList, OffWifiConnected, SetWifiList } from "../interface.uts"
/**
* Wifi 函数通用入参封装
*/
type WifiOption = {
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
};
/**
* Wifi 链接参数封装
*/
type WifiConnectOption = {
SSID?: string;
BSSID?: string;
password?: string;
maunal?: boolean;
partialInfo?: boolean; //ios不生效
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
}
/**
* 获取当前链接的wifi信息
*/
type GetConnectedWifiOptions = {
partialInfo?: boolean
success?: (res: UniWifiResult) => void
fail?: (res: UniWifiResult) => void
complete?: (res: UniWifiResult) => void
}
/*
* 对外暴露的wifi信息
*/
type UniWifiInfo = {
SSID: string;
BSSID: string;
secure: boolean;
signalStrength: number;
frequency: number;
}
type UniWifiResult = {
errCode : number,
errSubject : string,
errMsg : string,
wifi: UniWifiInfo | null
}
type UniWifiCallback = () => void
/*
...
...
@@ -153,8 +204,7 @@ class UniWiFiModuleGloabInfo {
/*
* 初始化wifi模块
*/
export const startWifi : StartWifi = function (option : WifiOption) {
export function startWifi(option: WifiOption) {
UniWiFiModuleGloabInfo.alreadyStartWifi = true
let res: UniWifiResult = {
errSubject: "uni-startWifi",
...
...
@@ -169,7 +219,7 @@ export const startWifi : StartWifi = function (option : WifiOption) {
/*
* 停止wifi模块
*/
export
const stopWifi : StopWifi = function (option
: WifiOption) {
export
function stopWifi(option
: WifiOption) {
UniWiFiModuleGloabInfo.alreadyStartWifi = false
LocationPromiseService.promiseCompletionHandler = []
let res: UniWifiResult = {
...
...
@@ -185,7 +235,7 @@ export const stopWifi : StopWifi = function (option : WifiOption) {
/*
* 获取wifi列表, 在调用之前需要引导用户跳转到系统设置-WIFI设置页面,系统搜索周边wifi后app才能接收到回调
*/
export
const getWifiList : GetWifiList = function (option
: WifiOption) {
export
function getWifiList(option
: WifiOption) {
let res: UniWifiResult = {
errSubject: "uni-getWifiList",
errCode: 12001,
...
...
@@ -199,14 +249,14 @@ export const getWifiList : GetWifiList = function (option : WifiOption) {
/* 获取wifi列表的回调
* note: 请在getWifiList方法的回调里调用该方法
*/
export
const onGetWifiList : OnGetWifiList = function
(callback: UniWifiCallback) {
export
function onGetWifiList
(callback: UniWifiCallback) {
}
/*
* 注销获取wifi列表的回调
*/
export
const offGetWifiList : OffGetWifiList = function
(callback: UniWifiCallback) {
export
function offGetWifiList
(callback: UniWifiCallback) {
}
...
...
@@ -214,7 +264,7 @@ export const offGetWifiList : OffGetWifiList = function (callback: UniWifiCallba
/*
* 获取当前连接的wifi信息
*/
export
const getConnectedWifi : GetConnectedWifi = function
(option: GetConnectedWifiOptions) {
export
function getConnectedWifi
(option: GetConnectedWifiOptions) {
if (UniWiFiModuleGloabInfo.alreadyStartWifi == false) {
let res: UniWifiResult = {
errSubject: "uni-getConnectedWifi",
...
...
@@ -249,7 +299,7 @@ export const getConnectedWifi : GetConnectedWifi = function (option: GetConnecte
/*
* 连接wifi
*/
export
const connectWifi : ConnectWifi = function
(option: WifiConnectOption) {
export
function connectWifi
(option: WifiConnectOption) {
let res: UniWifiResult = {
errSubject: "uni-connectWifi",
errCode: 12001,
...
...
@@ -264,36 +314,35 @@ export const connectWifi : ConnectWifi = function (option: WifiConnectOption) {
/*
* 连上wifi事件的监听函数
*/
export
const onWifiConnected : OnWifiConnected = function
(callback: UniWifiCallback) {
export
function onWifiConnected
(callback: UniWifiCallback) {
}
/*
* 连上wifi事件的监听函数, wifiInfo仅包含ssid
*/
export
const onWifiConnectedWithPartialInfo : OnWifiConnectedWithPartialInfo = function
(callback: UniWifiCallback) {
export
function onWifiConnectedWithPartialInfo
(callback: UniWifiCallback) {
}
/*
* 移除连接上wifi的事件的监听函数,不传此参数则移除所有监听函数。
*/
export
const offWifiConnected : OffWifiConnected = function
(callback: UniWifiCallback | null) {
export
function offWifiConnected
(callback: UniWifiCallback | null) {
}
/*
* 移除连接上wifi的事件的监听函数,不传此参数则移除所有监听函数。
*/
export
const onOffWifiConnectedWithPartialInfo : OnOffWifiConnectedWithPartialInfo = function
(callback: UniWifiCallback | null) {
export
function onOffWifiConnectedWithPartialInfo
(callback: UniWifiCallback | null) {
}
/*
* 设置 wifiList 中 AP 的相关信息。在 onGetWifiList 回调后调用,iOS特有接口。
*/
export
const setWifiList : SetWifiList = function
(option: WifiOption) {
export
function setWifiList
(option: WifiOption) {
let res: UniWifiResult = {
errSubject: "uni-setWifiList",
errCode: 12001,
...
...
uni_modules/uni-wifi/utssdk/interface.uts
已删除
100644 → 0
浏览文件 @
47afda52
/**
* Wifi 函数通用入参封装
*/
export type WifiOption = {
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
};
/**
* Wifi 链接参数封装
*/
export type WifiConnectOption = {
SSID?: string;
BSSID?: string;
password?: string;
maunal?: boolean;
partialInfo?: boolean; //ios不生效
success?: (res: UniWifiResult) => void;
fail?: (res: UniWifiResult) => void;
complete?: (res: UniWifiResult) => void;
}
/**
* 获取当前链接的wifi信息
*/
export type GetConnectedWifiOptions = {
partialInfo?: boolean
success?: (res: UniWifiResult) => void
fail?: (res: UniWifiResult) => void
complete?: (res: UniWifiResult) => void
}
/*
* 对外暴露的wifi信息
*/
export type UniWifiInfo = {
SSID: string;
BSSID: string;
secure: boolean;
signalStrength: number;
frequency: number;
}
export type UniWifiResult = {
errCode : number,
errSubject : string,
errMsg : string,
wifi: UniWifiInfo | null
}
export type UniWifiCallback = () => void
export type StartWifi = (option: WifiOption) => void
export type StopWifi = (option: WifiOption) => void
export type GetWifiList = (option: WifiOption) => void
export type OnGetWifiList = (callback: UniWifiCallback) => void
export type OffGetWifiList = (callback: UniWifiCallback) => void
export type GetConnectedWifi = (option: GetConnectedWifiOptions) => void
export type ConnectWifi = (option: WifiConnectOption) => void
export type OnWifiConnected = (callback: UniWifiCallback) => void
export type OnWifiConnectedWithPartialInfo = (callback: UniWifiCallback) => void
export type OffWifiConnected = (callback: UniWifiCallback | null) => void
export type OnOffWifiConnectedWithPartialInfo = (callback: UniWifiCallback | null) => void
export type SetWifiList = (option: WifiOption) => void
interface uni {
startWifi : StartWifi,
stopWifi : StopWifi,
getWifiList : GetWifiList,
onGetWifiList : OnGetWifiList,
offGetWifiList : OffGetWifiList,
getConnectedWifi : GetConnectedWifi,
onWifiConnected : OnWifiConnected,
onWifiConnectedWithPartialInfo : OnWifiConnectedWithPartialInfo,
offWifiConnected : OffWifiConnected,
onOffWifiConnectedWithPartialInfo : OnOffWifiConnectedWithPartialInfo,
setWifiList : SetWifiList,
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录