diff --git a/Runtime/Plugins/AES.jslib.meta b/Runtime/Plugins/AES.jslib.meta index adf508e7..4df30809 100644 --- a/Runtime/Plugins/AES.jslib.meta +++ b/Runtime/Plugins/AES.jslib.meta @@ -11,6 +11,17 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 0 + Exclude Win: 1 + Exclude Win64: 1 - first: Any: second: @@ -39,7 +50,7 @@ PluginImporter: - first: WebGL: WebGL second: - enabled: 0 + enabled: 1 settings: {} - first: WeixinMiniGame: WeixinMiniGame diff --git a/Runtime/Plugins/MD5.jslib.meta b/Runtime/Plugins/MD5.jslib.meta index 3f76a766..591afb37 100644 --- a/Runtime/Plugins/MD5.jslib.meta +++ b/Runtime/Plugins/MD5.jslib.meta @@ -11,6 +11,17 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 0 + Exclude Win: 1 + Exclude Win64: 1 - first: Any: second: @@ -30,16 +41,42 @@ PluginImporter: second: enabled: 0 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS - first: Facebook: WebGL second: enabled: 0 settings: {} - first: - WebGL: WebGL + Standalone: Linux64 second: enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 settings: {} - first: WeixinMiniGame: WeixinMiniGame diff --git a/Runtime/Plugins/crypto.jspre.meta b/Runtime/Plugins/crypto.jspre.meta index cebbc727..fc83ec33 100644 --- a/Runtime/Plugins/crypto.jspre.meta +++ b/Runtime/Plugins/crypto.jspre.meta @@ -11,6 +11,17 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 0 + Exclude Win: 1 + Exclude Win64: 1 - first: Any: second: @@ -39,7 +50,7 @@ PluginImporter: - first: WebGL: WebGL second: - enabled: 0 + enabled: 1 settings: {} - first: WeixinMiniGame: WeixinMiniGame diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll deleted file mode 100644 index 5d1f5722..00000000 Binary files a/Runtime/Plugins/wx-runtime-editor.dll and /dev/null differ diff --git a/Runtime/Plugins/wx-runtime-editor.dll.meta b/Runtime/Plugins/wx-runtime-editor.dll.meta deleted file mode 100644 index 5b92c445..00000000 --- a/Runtime/Plugins/wx-runtime-editor.dll.meta +++ /dev/null @@ -1,96 +0,0 @@ -fileFormatVersion: 2 -guid: 30bbdd4df4b1a43bb83ed8e59cc42c54 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - '': Any - second: - enabled: 0 - settings: - Exclude Editor: 0 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXUniversal: 1 - Exclude WebGL: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Facebook: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: x86 - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: x86_64 - - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: AnyCPU - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/Plugins/wx-runtime-editor.xml b/Runtime/Plugins/wx-runtime-editor.xml deleted file mode 100644 index 356d90bd..00000000 --- a/Runtime/Plugins/wx-runtime-editor.xml +++ /dev/null @@ -1,10613 +0,0 @@ - - - - wx-runtime-editor - - - - - 云函数,调用前必须先Init初始化 - - - - - 初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html - - - - - - - 声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html - - 通过开放能力在小程序端 / web 端获取得到的 CloudID - 返回字符串,原样传回云函数调用就好 - - - - Banner 广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html - - - - - 监听 banner 广告尺寸变化事件。 - - banner 广告尺寸变化事件的回调函数 - - - - 取消监听 banner 广告尺寸变化事件 - - banner 广告尺寸变化事件的回调函数 - - - - 隐藏 banner 广告。 - - - - - 广告的基类 - - - - - 显示广告。 - - 成功回调 - 失败回调 - - - - 显示广告。 - - 成功回调 - 失败回调 - - - - 监听广告错误事件。 - - 广告错误事件的回调函数,可详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.onError.html - - - - 监听 banner 广告加载事件。 - - 广告加载事件的回调函数 - - - - 取消监听广告错误事件 - - 广告错误事件的回调函数 - - - - 取消监听广告加载事件 - - 广告加载事件的回调函数 - - - - 销毁广告,如果是激励视频广告且multiton参数默认设置为false,则请慎用Destroy,调用后,后续可能无法再创建激励视频广告 - - - - - 微信相机 - - - - - [Camera.closeFrameChange()](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.closeFrameChange.html) - 需要基础库: `2.9.0` - 关闭监听帧数据 - - - - - [Camera.destroy()](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.destroy.html) - 需要基础库: `2.9.0` - 销毁相机 - - - - - [Camera.listenFrameChange()](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.listenFrameChange.html) - 需要基础库: `2.9.0` - 开启监听帧数据 - - - - - [Camera.onAuthCancel(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.onAuthCancel.html) - 需要基础库: `2.9.0` - 监听用户不允许授权使用摄像头的情况 - - - - - [Camera.onCameraFrame(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.onCameraFrame.html) - 需要基础库: `2.9.0` - 监听摄像头实时帧数据 - - - - - [Camera.onStop(function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.onStop.html) - 需要基础库: `2.9.0` - 监听摄像头非正常终止事件,如退出后台等情况 - - - - - 图像像素点数据,一维数组,每四项表示一个像素点的 rgba - - - - - 图像数据矩形的高度 - - - - - 图像数据矩形的宽度 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 摄像头朝向,值为 front, back - - - - - 接口调用失败的回调函数 - - - - - 闪光灯,值为 auto, on, off - - - - - 相机的高度 - - - - - 帧数据图像尺寸,值为 small, medium, large - - - - - 接口调用成功的回调函数 - - - - - 相机的宽度 - - - - - 相机的左上角横坐标 - - - - - 相机的左上角纵坐标 - - - - - 调用客户端的canvas - - - - - 同步的将当前 Canvas 保存为一个临时文件 - 华为机型分享有已知bug,推荐使用异步版本 - - canvas 生成的临时文件路径 (本地路径) - - - - 异步的将当前 Canvas 保存为一个临时文件 - - - - - - 监听用户操作 - - - - - 停止监听用户操作 - - - - - 隐藏入口 - - - - - 显示入口 - - - - - 强制关闭 - - - - - 打开组件 - - - - - 设置组件tab - - - - - 设置签名,用于聊天房发消息验证 - - - - - 显示的横坐标,屏幕物理坐标 - - - - - 显示的纵坐标,屏幕物理坐标 - - - - - 自定义入口 icon cdn 地址 - - - - - 是否可拖拽 - - - - - 是否会吸附到左右 - - - - - 面板缩放比例,默认大小 40x40,低于 375 宽度的屏幕会等比缩小 - - - - - 插屏广告组件广告,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html - - - - - 监听广告关闭事件 - - 广告关闭事件的回调函数 - - - - 监听广告隐藏事件 - - 广告关闭事件的回调函数 - - - - 取消监听广告关闭事件 - - 广告关闭事件的回调函数 - - - - 取消监听广告隐藏事件 - - 广告关闭事件的回调函数 - - - - 隐藏原生模板广告。(某些模板广告无法隐藏) - - 成功回调 - 失败回调 - - - - [DownloadTask.abort()](https://developers.weixin.qq.com/minigame/dev/api/network/download/DownloadTask.abort.html) - 需要基础库: `1.4.0` - 中断下载任务 - - - - - [DownloadTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/download/DownloadTask.offHeadersReceived.html) - 需要基础库: `2.1.0` - 移除 HTTP Response Header 事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - DownloadTask.onHeadersReceived(listener) - DownloadTask.offHeadersReceived(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [DownloadTask.offProgressUpdate(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/download/DownloadTask.offProgressUpdate.html) - 需要基础库: `2.1.0` - 移除下载进度变化事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - DownloadTask.onProgressUpdate(listener) - DownloadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [DownloadTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/download/DownloadTask.onHeadersReceived.html) - 需要基础库: `2.1.0` - 监听 HTTP Response Header 事件。会比请求完成事件更早 - - - - - [DownloadTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/download/DownloadTask.onProgressUpdate.html) - 需要基础库: `1.4.0` - 监听下载进度变化事件 - - - - - Gets 微信提供了一个用户文件目录给开发者,开发者对这个目录有完全自由的读写权限。通过 WX.env.USER_DATA_PATH 可以获取到这个目录的路径。 - - - - - 按钮的样式 - - - - - 按钮的类型。 - 可选值: - - 'text': 可以设置背景色和文本的按钮; - - 'image': 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高; - - - - - 按钮的背景图片,仅当 type 为 `image` 时有效 - - - - - 按钮上的文本,仅当 type 为 `text` 时有效 - - - - - [FeedbackButton.destroy()](https://developers.weixin.qq.com/minigame/dev/api/open-api/feedback/FeedbackButton.destroy.html) - 销毁意见反馈按钮 - - - - - [FeedbackButton.hide()](https://developers.weixin.qq.com/minigame/dev/api/open-api/feedback/FeedbackButton.hide.html) - 隐藏意见反馈按钮。 - - - - - [FeedbackButton.offTap(function listener)](https://developers.weixin.qq.com/minigame/dev/api/open-api/feedback/FeedbackButton.offTap.html) - 移除意见反馈按钮的点击事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - FeedbackButton.onTap(listener) - FeedbackButton.offTap(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [FeedbackButton.onTap(function listener)](https://developers.weixin.qq.com/minigame/dev/api/open-api/feedback/FeedbackButton.onTap.html) - 监听意见反馈按钮的点击事件 - - - - - [FeedbackButton.show()](https://developers.weixin.qq.com/minigame/dev/api/open-api/feedback/FeedbackButton.show.html) - 显示意见反馈按钮 - - - - - 同步写文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFileSync.html - - 要写入的文件路径 (本地路径) - 要写入的文本 - 指定写入文件的字符编码 - 错误信息,如果成功的话返回ok - - - - 同步写文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFileSync.html - - 要写入的文件路径 (本地路径) - 要写入的二进制数据 - 指定写入文件的字符编码 - 错误信息,如果成功的话返回ok - - - - 将二进制写入文件, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeFile.html - - - - - - 将字符串写入文件, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - - - - - - 在文件结尾追加二进制内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - - - - - - 在文件结尾追加文本内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.appendFile.html - - - - - - 读取本地文件内容, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFile.html - - - - - - 同步读取本地文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFileSync.html - - 要读取的文件的路径 (本地路径) - 返回结果,失败为null - - - - - 同步读取本地文件,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readFileSync.html - - 要读取的文件的路径 (本地路径) - 指定读取文件的字符编码,不能为空 - - - - - 同步判断文件/目录是否存在 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.accessSync.html - - 要判断是否存在的文件/目录路径 (本地路径) - 成功返回 "access:ok" 其他为失败,不可访问 - - - - 判断文件/目录是否存在 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.access.html - - - - - - 同步复制文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFileSync.html - - 源文件路径,支持本地路径 - 目标文件路径,支持本地路径 - 成功返回 "copyFile:ok" 其他为失败 - - - - 复制文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFile.html - - - - - - 同步删除文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlinkSync.html - - 源文件路径,支持本地路径 - 成功返回 "unlink:ok" 其他为失败 - - - - 删除文件 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlink.html - - - - - - 创建目录, 详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdir.html - - - - - - 同步创建目录,详见 https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdirSync.html - - 创建的目录路径 (本地路径) - 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - - - - - 删除目录,https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.rmdir.html - - - - - - 同步删除目录,https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.rmdirSync.html - - 要删除的目录路径 (本地路径) - 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件 - - - - - - [ArrayBuffer FileSystemManager.readCompressedFileSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readCompressedFileSync.html) - 需要基础库: `2.21.1` - 同步读取指定压缩类型的本地文件内容 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 异步接口 - fs.readCompressedFile({ - filePath: '${wx.env.USER_DATA_PATH}/hello.br', - compressionAlgorithm: 'br', - success(res) { - console.log(res.data) - }, - fail(res) { - console.log('readCompressedFile fail', res) - } - }) - // 同步接口 - try { - const data = fs.readCompressedFileSync({ - filePath: '${wx.env.USER_DATA_PATH}/hello.br', - compressionAlgorithm: 'br', - }) - console.log(data) - } catch (err) { - console.log(err) - } - ``` - - - - - [FileSystemManager.close(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.close.html) - 需要基础库: `2.16.1` - 关闭文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 打开文件 - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - // 关闭文件 - fs.close({ - fd: res.fd - }) - } - }) - ``` - - - - - [FileSystemManager.fstat(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.fstat.html) - 需要基础库: `2.16.1` - 获取文件的状态信息 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 打开文件 - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - // 获取文件的状态信息 - fs.fstat({ - fd: res.fd, - success(res) { - console.log(res.stats) - } - }) - } - }) - ``` - - - - - [FileSystemManager.ftruncate(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.ftruncate.html) - 需要基础库: `2.16.1` - 对文件内容进行截断操作 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 打开文件 - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - // 对文件内容进行截断操作 - fs.ftruncate({ - fd: res.fd, - length: 10, // 从第10个字节开始截断文件 - success(res) { - console.log(res) - } - }) - } - }) - ``` - - - - - [FileSystemManager.getFileInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.getFileInfo.html) - 获取该小程序下的 本地临时文件 或 本地缓存文件 信息 - - - - - [FileSystemManager.getSavedFileList(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.getSavedFileList.html) - 获取该小程序下已保存的本地缓存文件列表 - - - - - [FileSystemManager.open(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) - 需要基础库: `2.16.1` - 打开文件,返回文件描述符 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - console.log(res.fd) - } - }) - ``` - - - - - [FileSystemManager.read(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.read.html) - 需要基础库: `2.16.1` - 读文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const ab = new ArrayBuffer(1024) - // 打开文件 - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - // 读取文件到 ArrayBuffer 中 - fs.read({ - fd: res.fd, - arrayBuffer: ab, - length: 10, - success(res) { - console.log(res) - } - }) - } - }) - ``` - - - - - [FileSystemManager.readZipEntry(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readZipEntry.html) - 需要基础库: `2.17.3` - 读取压缩包内的文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 读取zip内某个或多个文件 - fs.readZipEntry({ - filePath: 'wxfile://from/to.zip', - entries: [{ - path: 'some_folder/my_file.txt', // zip内文件路径 - encoding: 'utf-8', // 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - position: 0, // 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte - length: 10000, // 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte - }, { - path: 'other_folder/orther_file.txt', // zip内文件路径 - }], - success(res) { - console.log(res.entries) - // res.entries === { - // 'some_folder/my_file.txt': { - // errMsg: 'readZipEntry:ok', - // data: 'xxxxxx' - // }, - // 'other_folder/orther_file.txt': { - // data: (ArrayBuffer) - // } - // } - }, - fail(res) { - console.log(res.errMsg) - }, - }) - // 读取zip内所有文件。允许指定统一的encoding。position、length则不再允许指定,分别默认为0和文件长度 - fs.readZipEntry({ - filePath: 'wxfile://from/to.zip', - entries: 'all' - encoding: 'utf-8', // 统一指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - success(res) { - console.log(res.entries) - // res.entries === { - // 'some_folder/my_file.txt': { - // errMsg: 'readZipEntry:ok', - // data: 'xxxxxx' - // }, - // 'other_folder/orther_file.txt': { - // errMsg: 'readZipEntry:ok', - // data: 'xxxxxx' - // } - // } - }, - fail(res) { - console.log(res.errMsg) - }, - }) - ``` - - - - - - [FileSystemManager.removeSavedFile(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.removeSavedFile.html) - 删除该小程序下已保存的本地缓存文件 - - - - - [FileSystemManager.rename(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.rename.html) - 重命名文件。可以把文件从 oldPath 移动到 newPath - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.rename({ - oldPath: `${wx.env.USER_DATA_PATH}/hello.txt`, - newPath: `${wx.env.USER_DATA_PATH}/hello_new.txt`, - success(res) { - console.log(res) - }, - fail(res) { - console.error(res) - } - }) - // 同步接口 - try { - const res = fs.renameSync( - `${wx.env.USER_DATA_PATH}/hello.txt`, - `${wx.env.USER_DATA_PATH}/hello_new.txt` - ) - console.log(res) - } catch(e) { - console.error(e) - } - ``` - - - - - [FileSystemManager.renameSync(string oldPath, string newPath)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.renameSync.html) - [FileSystemManager.rename](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.rename.html) 的同步版本 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.rename({ - oldPath: `${wx.env.USER_DATA_PATH}/hello.txt`, - newPath: `${wx.env.USER_DATA_PATH}/hello_new.txt`, - success(res) { - console.log(res) - }, - fail(res) { - console.error(res) - } - }) - // 同步接口 - try { - const res = fs.renameSync( - `${wx.env.USER_DATA_PATH}/hello.txt`, - `${wx.env.USER_DATA_PATH}/hello_new.txt` - ) - console.log(res) - } catch(e) { - console.error(e) - } - ``` - - - - - [FileSystemManager.saveFile(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.saveFile.html) - 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。 - - - - - [FileSystemManager.truncate(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.truncate.html) - 需要基础库: `2.16.1` - 对文件内容进行截断操作 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.truncate({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - length: 10, // 从第10个字节开始截断 - success(res) { - console.log(res) - } - }) - ``` - - - - - [FileSystemManager.unzip(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unzip.html) - 解压文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.unzip({ - zipFilePath: `${wx.env.USER_DATA_PATH}/example.zip`, - targetPath: '${wx.env.USER_DATA_PATH}/example', - success(res) { - console.log(res) - }, - fail(res) { - console.error(res) - } - }) - ``` - - - - - [FileSystemManager.write(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.write.html) - 需要基础库: `2.16.1` - 写入文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - // 打开文件 - fs.open({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+', - success(res) { - // 写入文件 - fs.write({ - fd: res.fd, - data: 'some text', - success(res) { - console.log(res.bytesWritten) - } - }) - } - }) - ``` - - - - - [[ReadResult](https://developers.weixin.qq.com/minigame/dev/api/file/ReadResult.html) FileSystemManager.readSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.readSync.html) - 需要基础库: `2.16.1` - 读文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const ab = new ArrayBuffer(1024) - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - const res = fs.readSync({ - fd: fd, - arrayBuffer: ab, - length: 10 - }) - console.log(res) - ``` - - - - - [[Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html) FileSystemManager.fstatSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.fstatSync.html) - 需要基础库: `2.16.1` - 同步获取文件的状态信息 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - const stats = fs.fstatSync({fd: fd}) - console.log(stats) - ``` - - - - - [[Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html)|Array.<[Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html)> FileSystemManager.statSync(string path, boolean recursive)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.statSync.html) - [FileSystemManager.stat](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.stat.html) 的同步版本 - 只支持传目录 - - - - - [[WriteResult](https://developers.weixin.qq.com/minigame/dev/api/file/WriteResult.html) FileSystemManager.writeSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.writeSync.html) - 需要基础库: `2.16.1` - 同步写入文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - const res = fs.writeSync({ - fd: fd, - data: 'some text' - }) - console.log(res.bytesWritten) - ``` - - - - - [string FileSystemManager.openSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) - 需要基础库: `2.16.1` - 同步打开文件,返回文件描述符 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - console.log(fd) - ``` - - - - - [string FileSystemManager.saveFileSync(string tempFilePath, string filePath)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.saveFileSync.html) - [FileSystemManager.saveFile](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.saveFile.html) 的同步版本 - - - - - [undefined FileSystemManager.closeSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.closeSync.html) - 需要基础库: `2.16.1` - 同步关闭文件 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - // 关闭文件 - fs.closeSync({fd: fd}) - ``` - - - - - [undefined FileSystemManager.ftruncateSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.ftruncateSync.html) - 需要基础库: `2.16.1` - 对文件内容进行截断操作 - **示例代码** - ```js - const fs = wx.getFileSystemManager() - const fd = fs.openSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - flag: 'a+' - }) - fs.ftruncateSync({ - fd: fd, - length: 10 // 从第10个字节开始截断文件 - }) - ``` - - - - - [undefined FileSystemManager.truncateSync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.truncateSync.html) - 需要基础库: `2.16.1` - 对文件内容进行截断操作 (truncate 的同步版本) - **示例代码** - ```js - const fs = wx.getFileSystemManager() - fs.truncateSync({ - filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, - length: 10, // 从第10个字节开始截断 - }) - ``` - - - - - 游戏对局回放 - - - - - 视频比特率(kbps),默认值1000,最大值 3000,最小值 600 - - - - - 视频的时长限制,单位为秒(s)。最大值 7200,最小值 5,到达指定时长后不会再录入。但还需要手动调用 [GameRecorder.stop()](https://developers.weixin.qq.com/minigame/dev/api/game-recorder/GameRecorder.stop.html) 来结束录制。 - - - - - 视频 fps - - - - - 视频关键帧间隔 - - - - - 需要基础库: `2.10.0` - - 是否录制游戏音效(仅iOS支持) - - - - - 音频类,详见 https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html - - - - - 内部函数,请不要调用 - - - - - - Gets or sets a value indicating whether 是否自动开始播放,默认为 false - - - - - Gets or sets 音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址 - - - - - Gets or sets a value indicating whether 是否需要先下载后播放 - - - - - Gets or sets 开始播放的位置(单位:s),默认为 0 - - - - - Gets or sets a value indicating whether 是否循环播放,默认为 false - - - - - Gets or sets 音量。范围 0~1。默认为 1 - - - - - Gets or sets a value indicating whether 静音,静音时将音量设置为 0,取消静音则恢复原来的音量 - - - - - Gets or sets 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) - - - - - Gets 当前音频的长度(单位 s)。只有在当前有合法的 src 时返回(只读) - - - - - Gets 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(只读) - - - - - Gets 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(只读) - - - - - Gets a value indicating whether 当前是是否暂停或停止状态(只读) - - - - - 播放 - - - - - 暂停。暂停后的音频再播放会从暂停处开始播放 - - - - - 停止。停止后的音频再播放会从头开始播放。 - - - - - 跳转到指定位置 - - - - - 销毁当前实例 - - - - - 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放 - - - - - 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放,action 为空表示移除全部事件监听 - - - - - 监听音频播放事件 - - - - - 取消监听音频播放事件,action 为空表示移除全部事件监听 - - - - - 监听音频暂停事件 - - - - - 取消监听音频暂停事件,action 为空表示移除全部事件监听 - - - - - 监听音频暂停事件 - - - - - 取消监听音频暂停事件,action 为空表示移除全部事件监听 - - - - - 监听音频自然播放至结束的事件 - - - - - 取消监听音频自然播放至结束的事件,action 为空表示移除全部事件监听 - - - - - 监听音频播放进度更新事件 - - - - - 取消监听音频播放进度更新事件,action 为空表示移除全部事件监听 - - - - - 监听音频播放错误事件 - - - - - 取消监听音频播放错误事件,action 为空表示移除全部事件监听 - - - - - 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 - - - - - 取消监听音频加载中事件,action 为空表示移除全部事件监听 - - - - - 监听音频进行跳转操作的事件 - - - - - 取消监听音频进行跳转操作的事件,action 为空表示移除全部事件监听 - - - - - 监听音频完成跳转操作的事件 - - - - - 取消监听音频完成跳转操作的事件,action 为空表示移除全部事件监听 - - - - - 加载插屏广告 - - - - - 监听插屏广告关闭事件 - - 插屏广告关闭事件的回调函数 - - - - 取消监听插屏广告关闭事件 - - 插屏广告关闭事件的回调函数 - - - - 微信小游戏启动剧情交互句柄 - - - - - 设置游戏剩余 30% 外显进度情况 - - 取值 0.0 ~ 1.0 对应完整进度条的 70%~100% - - - - 获取当前剧情组件的运行状态 - - True 为正在运行;False 为未运行或已结束 - - - - 提前结束正在运行的游戏 - - - - - 注册当剧情结束时的回调函数 - 由于 C# 代码启动较晚,如果在开发者注册时剧情已经结束,则在注册该方法时会立即产生回调,注册的回调只会产生1次 - - 回调函数 - - - - 卸载当剧情结束时的回调函数 - - 回调函数句柄 - - - - 设置剧情全局变量 - - 被设置的变量Key - 被设置的变量Value - - - - 读取剧情全局变量 - - 被读取的变量Key - 返回剧情全局变量值,若返回 null 代表全局变量不存在。 - - - - 判断是否播放了某条故事线 - - 故事线uid - True 播放;False 未播放 - - - - 运行JS函数 - - - - - [LogManager.debug()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.debug.html) - 写 debug 日志 - - - - - [LogManager.info()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.info.html) - 写 info 日志 - - - - - [LogManager.log()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.log.html) - 写 log 日志 - - - - - [LogManager.warn()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.warn.html) - 写 warn 日志 - - - - - 长时间才返回的用这个 - - - - - 如果返回二进制,则数据在这个字段 - - - - - 如果返回的是字符串,则数据在这个字段 - - - - - 视频是否是在用户完整观看的情况下被关闭的,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.onClose.html - - - - - 云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html - - - - - 后端返回的经过json序列化后的数据 - - - - - 对应JS版里的 extraData,这里序列化成JSON字符串 - - - - - 详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/UserInfo.html - - - - - 创建 banner 广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createBannerAd.html - - - - - 创建激励视频广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createRewardedVideoAd.html - - - - - 创建插屏广告组件参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createInterstitialAd.html - - - - - 创建原生模板广告参数,参数详见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createCustomAd.html - - - - - 原生模板广告组件的样式 - - - - - 原生模板广告组件的左上角横坐标 - - - - - 原生模板广告组件的左上角纵坐标 - - - - - 原生模板广告组件的宽度 - - - - - 将当前 Canvas 保存为一个临时文件的同步版本,详见 https://developers.weixin.qq.com/minigame/dev/api/render/canvas/Canvas.toTempFilePathSync.html - - - - - canvas 生成的临时文件路径 (本地路径) - - - - - 将当前 Canvas 保存为一个临时文件的异步版本,详见 https://developers.weixin.qq.com/minigame/dev/api/render/canvas/Canvas.toTempFilePath.html - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.access.html - - - - - https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.unlink.html - - - - - https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.mkdir.html - - - - - 创建的目录路径 (本地路径) - - - - - 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 - - - - - https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html - - - - - 要删除的目录路径 (本地路径) - - - - - 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 - - - - - https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.copyFile.html - - - - - 当前所有触摸点的列表 - - - - - 触发此次事件的触摸点列表,可以通过这个知道触发当前通知的事件的位置 - - - - - 事件触发时的时间戳 - - - - - 调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html - - - - - 这里请将数据json序列化为字符串再赋值到data - - - - - 云函数初始化 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html - - - - - 必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源 - - - - - 是否在将用户访问记录到用户管理中,在控制台中可见 - - - - - 音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址 - - - - - 是否循环播放,默认为 false - - - - - 开始播放的位置(单位:s),默认为 0 - - - - - 是否自动开始播放,默认为 false - - - - - 音量。范围 0~1。默认为 1 - - - - - 播放速度。范围 0.5-2.0,默认为 1。 - - - - - 下载音频,设置为true后,会完全下载后再触发OnCanplay,方便后续音频复用,避免延迟 - - - - - 网络状态变化事件的回调参数,详见 https://developers.weixin.qq.com/minigame/dev/api/device/network/wx.onNetworkStatusChange.html - - - - - 当前是否有网络连接 - - - - - 网络类型 - - - - - 要写入的文件路径 (本地路径) - - - - - 要写入的二进制数据 - - - - - 指定写入文件的字符编码 - - - - - 要写入的文件路径 (本地路径) - - - - - 要写入的二进制数据 - - - - - 指定写入文件的字符编码 - - - - - 要读取的文件的路径 (本地路径) - - - - - 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - - - - - 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte - - - - - 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte - - - - - 如果返回二进制,则数据在这个字段 - - - - - 要读取的文件的路径 (本地路径) - - - - - 如果返回二进制,则数据在这个字段 - - - - - 如果返回的是字符串,则数据在这个字段 - - - - - 文件的类型和存取的权限,对应 POSIX stat.st_mode - - - - - 文件大小,单位:B,对应 POSIX stat.st_size - - - - - 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime - - - - - 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime - - - - - 文件的路径 - - - - - 文件/目录路径 (本地路径) - - - - - 是否递归获取目录下的每个文件的 Stats 信息 2.3.0 - - - - - 当前的播放位置,单位为秒 - - - - - 视频的总时长,单位为秒 - - - - - 当前的缓冲进度,缓冲进度区间为 (0~100],100表示缓冲完成 - - - - - 视频的总时长,单位为秒 - - - - - 当前的缓冲进度,缓冲进度区间为 (0~100],100表示缓冲完成 - - - - - 当前的播放位置,单位为秒 - - - - - 视频的总时长,单位为秒 - - - - - 视频的左上角横坐标 - - - - - 视频的左上角纵坐标 - - - - - 视频的宽度 - - - - - 视频的高度 - - - - - 视频的资源地址 - - - - - 视频的封面 - - - - - 视频的初始播放位置,单位为 s 秒 - - - - - 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 - - - - - 视频是否为直播 - - - - - 视频的缩放模式 - - - - - 视频是否显示控件 - - - - - 是否显示视频底部进度条 - - - - - 是否显示控制栏的进度条 - - - - - 视频背景颜色 - - - - - 视频是否自动播放 - - - - - 视频是否是否循环播放 - - - - - 视频是否禁音播放 - - - - - 视频是否遵循系统静音开关设置(仅iOS) - - - - - 是否启用手势控制播放进度 - - - - - 是否开启双击播放的手势 - - - - - 是否显示视频中央的播放按钮 - - - - - 视频是否显示在游戏画布之下 - - - - - 开发版 - - - - - 体验版 - - - - - 正式版 - - - - - 可以设置背景色和文本的按钮 - - - - - 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高 - - - - - 居左 - - - - - 居中 - - - - - 居右 - - - - - 创建游戏圈参数,详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/game-club/wx.createGameClubButton.html - - - - - 必填,按钮类型 - - - - - 按钮上的文本,仅当 type 为 text 时有效 - - - - - 按钮的背景图片,仅当 type 为 image 时有效 - - - - - 必填,按钮的样式 - - - - - 必填,游戏圈按钮的图标,仅当 object.type 参数为 image 时有效。 - - - - - 需要基础库: `2.30.3` 当传递了openlink值时,此字段生效,决定创建的按钮是否需要拥有红点,默认为true - - - - - 需要基础库: `2.30.3` 设置后可以跳到对应的活动页面,具体进入mp设置-游戏设置-开始管理-游戏圈管理-由帖子的"游戏内跳转ID"生成 - - - - - 清理文件缓存的结果 - - - - - 无需清理,空间足够 - - - - - 超过最大存储容量,不清理 - - - - - 清理成功 - - - - - 启动数据 - - - - - 当前阶段耗时 - - - - - 自插件启动后总运行时间 - - - - - 是否需要下载资源包 - - - - - 首包资源是否作为小游戏代码分包下载 - - - - - 当前阶段完成时是否处于前台 - - - - - 是否开启了代码分包 - - - - - 是否iOS高性能模式 - - - - - 启动阶段类型定义 - - - - - 插件启动 - - - - - 下载wasm代码 - - - - - 编译wasm - - - - - 下载首包资源 - - - - - 读取首包资源 - - - - - 引擎初始化(callmain) - - - - - 可选值: - - 10001: 系统错误; - - 10002: 网络错误; - - 10003: 文件错误; - - 10004: 格式错误; - - -1: 未知错误; - - - - - 文件压缩类型,目前仅支持 'br'。 - 可选值: - - 'br': brotli压缩文件; - - - - - 要读取的文件的路径 (本地用户文件或代码包文件) - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 1300001 | operation not permitted | 操作不被允许(例如,filePath 预期传入一个文件而实际传入一个目录) | - | 1300002 | no such file or directory ${path} | 文件/目录不存在,或者目标文件路径的上层目录不存在 | - | 1300005 | Input/output error | 输入输出流不可用 | - | 1300009 | bad file descriptor | 无效的文件描述符 | - | 1300013 | permission denied | 权限错误,文件是只读或只写 | - | 1300014 | Path permission denied | 传入的路径没有权限 | - | 1300020 | not a directory | dirPath 指定路径不是目录,常见于指定的写入路径的上级路径为一个文件的情况 | - | 1300021 | Is a directory | 指定路径是一个目录 | - | 1300022 | Invalid argument | 无效参数,可以检查length或offset是否越界 | - | 1300036 | File name too long | 文件名过长 | - | 1300066 | directory not empty | 目录不为空 | - | 1300201 | system error | 系统接口调用失败 | - | 1300202 | the maximum size of the file storage limit is exceeded | 存储空间不足,或文件大小超出上限(上限100M) | - | 1300203 | base64 encode error | 字符编码转换失败(例如 base64 格式错误) | - | 1300300 | sdcard not mounted | android sdcard 挂载失败 | - | 1300301 | unable to open as fileType | 无法以fileType打开文件 | - | 1301000 | permission denied, cannot access file path | 目标路径无访问权限(usr目录) | - | 1301002 | data to write is empty | 写入数据为空 | - | 1301003 | illegal operation on a directory | 不可对目录进行此操作(例如,指定的 filePath 是一个已经存在的目录) | - | 1301004 | illegal operation on a package directory | 不可对代码包目录进行此操作 | - | 1301005 | file already exists ${dirPath} | 已有同名文件或目录 | - | 1301006 | value of length is out of range | 传入的 length 不合法 | - | 1301007 | value of offset is out of range | 传入的 offset 不合法 | - | 1301009 | value of position is out of range | position值越界 | - | 1301100 | store directory is empty | store目录为空 | - | 1301102 | unzip open file fail | 压缩文件打开失败 | - | 1301103 | unzip entry fail | 解压单个文件失败 | - | 1301104 | unzip fail | 解压失败 | - | 1301111 | brotli decompress fail | brotli解压失败(例如,指定的 compressionAlgorithm 与文件实际压缩格式不符) | - | 1301112 | tempFilePath file not exist | 指定的 tempFilePath 找不到文件 | - | 1302001 | fail permission denied | 指定的 fd 路径没有读权限/没有写权限 | - | 1302002 | excced max concurrent fd limit | fd数量已达上限 | - | 1302003 | invalid flag | 无效的flag | - | 1302004 | permission denied when open using flag | 无法使用flag标志打开文件 | - | 1302005 | array buffer does not exist | 未传入arrayBuffer | - | 1302100 | array buffer is readonly | arrayBuffer只读 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 1300001 | operation not permitted | 操作不被允许(例如,filePath 预期传入一个文件而实际传入一个目录) | - | 1300002 | no such file or directory ${path} | 文件/目录不存在,或者目标文件路径的上层目录不存在 | - | 1300005 | Input/output error | 输入输出流不可用 | - | 1300009 | bad file descriptor | 无效的文件描述符 | - | 1300013 | permission denied | 权限错误,文件是只读或只写 | - | 1300014 | Path permission denied | 传入的路径没有权限 | - | 1300020 | not a directory | dirPath 指定路径不是目录,常见于指定的写入路径的上级路径为一个文件的情况 | - | 1300021 | Is a directory | 指定路径是一个目录 | - | 1300022 | Invalid argument | 无效参数,可以检查length或offset是否越界 | - | 1300036 | File name too long | 文件名过长 | - | 1300066 | directory not empty | 目录不为空 | - | 1300201 | system error | 系统接口调用失败 | - | 1300202 | the maximum size of the file storage limit is exceeded | 存储空间不足,或文件大小超出上限(上限100M) | - | 1300203 | base64 encode error | 字符编码转换失败(例如 base64 格式错误) | - | 1300300 | sdcard not mounted | android sdcard 挂载失败 | - | 1300301 | unable to open as fileType | 无法以fileType打开文件 | - | 1301000 | permission denied, cannot access file path | 目标路径无访问权限(usr目录) | - | 1301002 | data to write is empty | 写入数据为空 | - | 1301003 | illegal operation on a directory | 不可对目录进行此操作(例如,指定的 filePath 是一个已经存在的目录) | - | 1301004 | illegal operation on a package directory | 不可对代码包目录进行此操作 | - | 1301005 | file already exists ${dirPath} | 已有同名文件或目录 | - | 1301006 | value of length is out of range | 传入的 length 不合法 | - | 1301007 | value of offset is out of range | 传入的 offset 不合法 | - | 1301009 | value of position is out of range | position值越界 | - | 1301100 | store directory is empty | store目录为空 | - | 1301102 | unzip open file fail | 压缩文件打开失败 | - | 1301103 | unzip entry fail | 解压单个文件失败 | - | 1301104 | unzip fail | 解压失败 | - | 1301111 | brotli decompress fail | brotli解压失败(例如,指定的 compressionAlgorithm 与文件实际压缩格式不符) | - | 1301112 | tempFilePath file not exist | 指定的 tempFilePath 找不到文件 | - | 1302001 | fail permission denied | 指定的 fd 路径没有读权限/没有写权限 | - | 1302002 | excced max concurrent fd limit | fd数量已达上限 | - | 1302003 | invalid flag | 无效的flag | - | 1302004 | permission denied when open using flag | 无法使用flag标志打开文件 | - | 1302005 | array buffer does not exist | 未传入arrayBuffer | - | 1302100 | array buffer is readonly | arrayBuffer只读 | - - - - - 需要被关闭的文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 目标文件路径,支持本地路径 - - - - - 源文件路径,支持本地路径 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - [Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html) - Stats 对象,包含了文件的状态信息 - - - - - 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime - - - - - 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime - - - - - 文件的类型和存取的权限,对应 POSIX stat.st_mode - - - - - 文件大小,单位:B,对应 POSIX stat.st_size - - - - - 判断当前文件是否一个目录 - - - - - 判断当前文件是否一个普通文件 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') - - - - - 要读取的文件路径 (本地路径) - - - - - 文件大小,以字节为单位 - - - - - 文件数组 - - - - - 文件保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 - - - - - 文件路径 (本地路径) - - - - - 本地文件大小,以字节为单位 - - - - - 文件路径 (本地路径) - - - - - 文件系统标志,默认值: 'r' - 可选值: - - 'a': 打开文件用于追加。 如果文件不存在,则创建该文件; - - 'ax': 类似于 'a',但如果路径存在,则失败; - - 'a+': 打开文件用于读取和追加。 如果文件不存在,则创建该文件; - - 'ax+': 类似于 'a+',但如果路径存在,则失败; - - 'as': 打开文件用于追加(在同步模式中)。 如果文件不存在,则创建该文件; - - 'as+': 打开文件用于读取和追加(在同步模式中)。 如果文件不存在,则创建该文件; - - 'r': 打开文件用于读取。 如果文件不存在,则会发生异常; - - 'r+': 打开文件用于读取和写入。 如果文件不存在,则会发生异常; - - 'w': 打开文件用于写入。 如果文件不存在则创建文件,如果文件存在则截断文件; - - 'wx': 类似于 'w',但如果路径存在,则失败; - - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; - - 'wx+': 类似于 'w+',但如果路径存在,则失败; - - - - - 文件描述符 - - - - - 数据写入的缓冲区,必须是 ArrayBuffer 实例 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 要从文件中读取的字节数,默认0 - - - - - 缓冲区中的写入偏移量,默认0 - - - - - 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 - - - - - 被写入的缓存区的对象,即接口入参的 arrayBuffer - - - - - 实际读取的字节数 - - - - - 文件压缩类型,目前仅支持 'br'。 - 可选值: - - 'br': brotli压缩文件; - - - - - 要读取的文件的路径 (本地用户文件或代码包文件) - - - - - 文件内容 - - - - - 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) - - - - - 要读取的压缩包的路径 (本地路径) - - - - - 统一指定读取文件的字符编码,只在 entries 值为"all"时有效。如果 entries 值为"all"且不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) - - - - - 要读取的压缩包的路径 (本地路径) - - - - - 统一指定读取文件的字符编码,只在 entries 值为"all"时有效。如果 entries 值为"all"且不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 压缩包内文件路径 - - - - - 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte - - - - - 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte - - - - - 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 - - - - - 文件内容 - - - - - 错误信息 - - - - - 要读取的目录路径 (本地路径) - - - - - 指定目录下的文件名数组。 - - - - - 需要删除的文件路径 (本地路径) - - - - - 新文件路径,支持本地路径 - - - - - 源文件路径,支持本地路径 - - - - - 临时存储文件路径 (本地路径) - - - - - 要存储的文件路径 (本地路径) - - - - - 存储后的文件路径 (本地路径) - - - - - 文件/目录路径 (本地路径) - - - - - 需要基础库: `2.3.0` - 是否递归获取目录下的每个文件的 Stats 信息 - - - - - [Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html)|Array.<[Stats](https://developers.weixin.qq.com/minigame/dev/api/file/Stats.html)> - 当 recursive 为 false 时,res.stats 是一个 Stats 对象。当 recursive 为 true 且 path 是一个目录的路径时,res.stats 是一个 Array,数组的每一项是一个对象,每个对象包含 path 和 stats。 - - - - - 要截断的文件路径 (本地路径) - - - - - 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') - - - - - 要删除的文件路径 (本地路径) - - - - - 目标目录路径, 支持本地路径 - - - - - 源文件路径,支持本地路径, 只可以是 zip 压缩文件 - - - - - 写入的内容,类型为 String 或 ArrayBuffer - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 - - - - - 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 - - - - - 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 - - - - - 写入的内容,类型为 String 或 ArrayBuffer - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 - - - - - 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 - - - - - 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 - - - - - 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) - - - - - 数据写入的缓冲区,必须是 ArrayBuffer 实例 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 要从文件中读取的字节数,默认0 - - - - - 缓冲区中的写入偏移量,默认0 - - - - - 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 写入的内容,类型为 String 或 ArrayBuffer - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 - - - - - 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 - - - - - 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 - - - - - 写入的内容,类型为 String 或 ArrayBuffer - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 - 可选值: - - 'ascii': ; - - 'base64': ; - - 'binary': ; - - 'hex': ; - - 'ucs2': 以小端序读取; - - 'ucs-2': 以小端序读取; - - 'utf16le': 以小端序读取; - - 'utf-16le': 以小端序读取; - - 'utf-8': ; - - 'utf8': ; - - 'latin1': ; - - - - - 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 - - - - - 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 - - - - - 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 - - - - - 文件路径 (本地路径) - - - - - 文件系统标志,默认值: 'r' - 可选值: - - 'a': 打开文件用于追加。 如果文件不存在,则创建该文件; - - 'ax': 类似于 'a',但如果路径存在,则失败; - - 'a+': 打开文件用于读取和追加。 如果文件不存在,则创建该文件; - - 'ax+': 类似于 'a+',但如果路径存在,则失败; - - 'as': 打开文件用于追加(在同步模式中)。 如果文件不存在,则创建该文件; - - 'as+': 打开文件用于读取和追加(在同步模式中)。 如果文件不存在,则创建该文件; - - 'r': 打开文件用于读取。 如果文件不存在,则会发生异常; - - 'r+': 打开文件用于读取和写入。 如果文件不存在,则会发生异常; - - 'w': 打开文件用于写入。 如果文件不存在则创建文件,如果文件存在则截断文件; - - 'wx': 类似于 'w',但如果路径存在,则失败; - - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; - - 'wx+': 类似于 'w+',但如果路径存在,则失败; - - - - - 需要被关闭的文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/minigame/dev/api/file/FileSystemManager.openSync.html) 接口获得 - - - - - 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') - - - - - 要截断的文件路径 (本地路径) - - - - - 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') - - - - - 被写入的缓存区的对象,即接口入参的 arrayBuffer - - - - - 实际读取的字节数 - - - - - 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) - - - - - 可以发送的事件,曝光:"exposureAuthorization",同意:"agree",拒绝:"disagree" - - - - - 当前 wifi 网络的 BSSID ,可通过 wx.getConnectedWifi 获取 - - - - - 套接字要连接的地址 - - - - - 套接字要连接的端口 - - - - - 套接字要连接的超时时间,默认为 2s - - - - - 接收端地址信息 - - - - - 收到的消息 - - - - - 发送端地址信息 - - - - - 接收消息的 socket 的地址 - - - - - 使用的协议族,为 IPv4 或者 IPv6 - - - - - 端口号 - - - - - 发送消息的 socket 的地址 - - - - - 使用的协议族,为 IPv4 或者 IPv6 - - - - - 端口号 - - - - - 要发消息的地址 - - - - - 要发送消息的端口号 - - - - - 接收端地址信息,2.18.0 起支持 - - - - - 收到的消息。消息长度需要小于4096。 - - - - - 发送端地址信息 - - - - - - 要发送的数据 - - - - - 要发送消息的端口号 - - - - - 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 - - - - - 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 - - - - - 向指定地址发消息时,是否要开启广播,基础库 2.24.0 开始支持 - - - - - - 要发送消息的端口号 - - - - - 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 - - - - - 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 - - - - - 向指定地址发消息时,是否要开启广播,基础库 2.24.0 开始支持 - - - - - 触发此次事件的触摸点列表 - - - - - 事件触发时的时间戳 - - - - - 当前所有触摸点的列表 - - - - - 触点相对于可见视区左边沿的 X 坐标。 - - - - - 触点相对于可见视区上边沿的 Y 坐标。 - - - - - 手指挤压触摸平面的压力大小, 从0.0(没有压力)到1.0(最大压力)的浮点数(仅在支持 force touch 的设备返回) - - - - - Touch 对象的唯一标识符,只读属性。一次触摸动作(我们值的是手指的触摸)在平面上移动的整个过程中, 该标识符不变。可以根据它来判断跟踪的是否是同一次触摸过程。 - - - - - 触点相对于页面左边沿的 X 坐标。 - - - - - 触点相对于页面上边沿的 Y 坐标。 - - - - - 蓝牙特征的 UUID - - - - - 蓝牙设备 id - - - - - 蓝牙特征对应服务的 UUID - - - - - 特征最新的值 - - - - - x 轴的角速度 - - - - - y 轴的角速度 - - - - - z 轴的角速度 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 监听陀螺仪数据回调函数的执行频率 - 可选值: - - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - - 'normal': 普通的回调频率,在 200ms/次 左右; - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 小程序账号信息 - - - - - 插件账号信息(仅在插件中调用时包含这一项) - - - - - 小程序 appId - - - - - 需要基础库: `2.10.0` - 小程序版本 - 可选值: - - 'develop': 开发版; - - 'trial': 体验版; - - 'release': 正式版; - - - - - 需要基础库: `2.10.2` - 线上小程序版本号 - - - - - 插件 appId - - - - - 插件版本号 - - - - - 允许微信使用相册的开关(仅 iOS 有效) - - - - - 允许微信使用蓝牙的开关(仅 iOS 有效) - - - - - 允许微信使用摄像头的开关 - - - - - 允许微信使用定位的开关 - - - - - 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效) - - - - - 允许微信使用麦克风的开关 - - - - - 允许微信通知带有提醒的开关(仅 iOS 有效) - - - - - 允许微信通知的开关 - - - - - 允许微信通知带有标记的开关(仅 iOS 有效) - - - - - 允许微信通知带有声音的开关(仅 iOS 有效) - - - - - 允许微信读写日历的开关 - - - - - 客户端基础库版本 - - - - - 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 - - - - - 当前小程序运行的宿主环境 - - - - - 微信设置的语言 - - - - - 微信版本号 - - - - - 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) - 可选值: - - 'dark': 深色主题; - - 'light': 浅色主题; - - - - - 宿主 app(第三方App) 对应的 appId (当小程序运行在第三方App环境时才返回) - - - - - 是否正在充电中 - - - - - 设备电量,范围 1 - 100 - - - - - 应用(微信APP)二进制接口类型(仅 Android 支持) - - - - - 设备性能等级(仅 Android 支持)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) - - - - - 设备品牌 - - - - - 需要基础库: `2.29.0` - 设备 CPU 型号(仅 Android 支持)(Tips: GPU 型号可通过 WebGLRenderingContext.getExtension('WEBGL_debug_renderer_info') 来获取) - - - - - 需要基础库: `2.25.1` - 设备二进制接口类型(仅 Android 支持) - - - - - 需要基础库: `2.30.0` - 设备内存大小,单位为 MB - - - - - 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 - - - - - 客户端平台 - - - - - 操作系统及版本 - - - - - 需要基础库: `2.20.0` - API 类别 - 可选值: - - 'default': 默认类别; - - 'nativeFunctionalized': 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序; - - 'browseOnly': 仅浏览,朋友圈快照页等场景打开的小程序; - - 'embedded': 内嵌,通过打开半屏小程序能力打开的小程序; - - - - - 启动小游戏的 query 参数 - - - - - 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) - - - - - 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/scene.html) - - - - - 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 - 可选值: - - 1: 微信联系人单聊; - - 2: 企业微信联系人单聊; - - 3: 普通微信群聊; - - 4: 企业微信互通群聊; - - - - - shareTicket,详见[获取更多转发信息](#) - - - - - 来源小程序、公众号或 App 的 appId - - - - - 来源小程序传过来的数据,scene=1037或1038时支持 - - - - - 从小游戏直播间里的挂件入口打开小游戏时,开发者可从启动参数中获取当前直播的直播间Id和直播者openId - - - - - 直播者 openId - - - - - 直播间 id - - - - - 启动小游戏的 query 参数 - - - - - 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) - - - - - 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/scene.html) - - - - - 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 - 可选值: - - 1: 微信联系人单聊; - - 2: 企业微信联系人单聊; - - 3: 普通微信群聊; - - 4: 企业微信互通群聊; - - - - - shareTicket,详见[获取更多转发信息](#) - - - - - 下边界坐标,单位:px - - - - - 高度,单位:px - - - - - 左边界坐标,单位:px - - - - - 右边界坐标,单位:px - - - - - 上边界坐标,单位:px - - - - - 宽度,单位:px - - - - - 当前占用的空间大小, 单位 KB - - - - - 当前 storage 中所有的 key - - - - - 限制的空间大小,单位 KB - - - - - 需要基础库: `1.1.0` - 客户端基础库版本 - - - - - 需要基础库: `2.6.0` - 允许微信使用相册的开关(仅 iOS 有效) - - - - - - 需要基础库: `2.6.0` - 蓝牙的系统开关 - - - - - 需要基础库: `1.5.0` - 设备品牌 - - - - - 需要基础库: `2.6.0` - 允许微信使用摄像头的开关 - - - - - 设备方向 - 可选值: - - 'portrait': 竖屏; - - 'landscape': 横屏; - - - - - 需要基础库: `2.15.0` - 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 - - - - - 需要基础库: `1.5.0` - 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 - - - - - 需要基础库: `2.12.3` - 当前小程序运行的宿主环境 - - - - - 微信设置的语言 - - - - - 需要基础库: `2.6.0` - 允许微信使用定位的开关 - - - - - 需要基础库: `2.6.0` - 地理位置的系统开关 - - - - - `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 - - - - - 需要基础库: `2.6.0` - 允许微信使用麦克风的开关 - - - - - 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 - - - - - 需要基础库: `2.6.0` - 允许微信通知带有提醒的开关(仅 iOS 有效) - - - - - 需要基础库: `2.6.0` - 允许微信通知的开关 - - - - - 需要基础库: `2.6.0` - 允许微信通知带有标记的开关(仅 iOS 有效) - - - - - 需要基础库: `2.6.0` - 允许微信通知带有声音的开关(仅 iOS 有效) - - - - - 需要基础库: `2.19.3` - 允许微信使用日历的开关 - - - - - 设备像素比 - - - - - 客户端平台 - 可选值: - - 'ios': iOS微信(包含 iPhone、iPad); - - 'android': Android微信; - - 'windows': Windows微信; - - 'mac': macOS微信; - - 'devtools': 微信开发者工具; - - - - - 需要基础库: `2.7.0` - 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 - - - - - 需要基础库: `1.1.0` - 屏幕高度,单位px - - - - - 需要基础库: `1.1.0` - 屏幕宽度,单位px - - - - - 需要基础库: `1.9.0` - 状态栏的高度,单位px - - - - - 操作系统及版本 - - - - - 微信版本号 - - - - - 需要基础库: `2.6.0` - Wi-Fi 的系统开关 - - - - - 可使用窗口高度,单位px - - - - - 可使用窗口宽度,单位px - - - - - 需要基础库: `2.11.0` - 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) - 可选值: - - 'dark': 深色主题; - - 'light': 浅色主题; - - - - - 宿主 app 对应的 appId - - - - - 安全区域右下角纵坐标 - - - - - 安全区域的高度,单位逻辑像素 - - - - - 安全区域左上角横坐标 - - - - - 安全区域右下角横坐标 - - - - - 安全区域左上角纵坐标 - - - - - 安全区域的宽度,单位逻辑像素 - - - - - 蓝牙的系统开关 - - - - - 设备方向 - 可选值: - - 'portrait': 竖屏; - - 'landscape': 横屏; - - - - - 地理位置的系统开关 - - - - - Wi-Fi 的系统开关 - - - - - 设备像素比 - - - - - 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 - - - - - 屏幕高度,单位px - - - - - 窗口上边缘的y值 - - - - - 屏幕宽度,单位px - - - - - 状态栏的高度,单位px - - - - - 可使用窗口高度,单位px - - - - - 可使用窗口宽度,单位px - - - - - 下载资源的 url - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `1.8.0` - 指定文件下载后存储的路径 (本地路径) - - - - - HTTP 请求的 Header,Header 中不能设置 Referer - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.10.0` - 超时时间,单位为毫秒,默认值为 60000 即一分钟。 - - - - - 错误信息 - - - - - 用户文件路径 (本地路径)。传入 filePath 时会返回,跟传入的 filePath 一致 - - - - - 需要基础库: `2.10.4` - 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) - - - - - 开发者服务器返回的 HTTP 状态码 - - - - - 临时文件路径 (本地路径)。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件 - - - - - SSL建立完成的时间,如果不是安全连接,则值为 0 - - - - - SSL建立连接的时间,如果不是安全连接,则值为 0 - - - - - HTTP(TCP) 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过 - - - - - HTTP(TCP) 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间 - - - - - DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 - - - - - DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 - - - - - 评估当前网络下载的kbps - - - - - 评估的网络状态 unknown, offline, slow 2g, 2g, 3g, 4g, last/0, 1, 2, 3, 4, 5, 6 - - - - - 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前 - - - - - 协议层根据多个请求评估当前网络的 rtt(仅供参考) - - - - - 当前请求的IP - - - - - 当前请求的端口 - - - - - 使用协议类型,有效值:http1.1, h2, quic, unknown - - - - - 收到字节数 - - - - - 最后一个 HTTP 重定向完成时的时间。有跳转且是同域名内部的重定向才算,否则值为 0 - - - - - 第一个 HTTP 重定向发生时的时间。有跳转且是同域名内的重定向才算,否则值为 0 - - - - - HTTP请求读取真实文档结束的时间 - - - - - HTTP请求读取真实文档开始的时间(完成建立连接),包括从本地读取缓存。连接错误重连时,这里显示的也是新建立连接的时间 - - - - - HTTP 响应全部接收完成的时间(获取到最后一个字节),包括从本地读取缓存 - - - - - HTTP 开始接收响应的时间(获取到第一个字节),包括从本地读取缓存 - - - - - 当次请求连接过程中实时 rtt - - - - - 发送的字节数 - - - - - 是否复用连接 - - - - - 当前网络的实际下载kbps - - - - - 传输层根据多个请求评估的当前网络的 rtt(仅供参考) - - - - - 开发者服务器返回的 HTTP Response Header - - - - - 下载进度百分比 - - - - - 预期需要下载的数据总长度,单位 Bytes - - - - - 已经下载的数据长度,单位 Bytes - - - - - 按钮的样式 - - - - - 按钮的类型。 - 可选值: - - 'text': 可以设置背景色和文本的按钮; - - 'image': 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高; - - - - - 按钮的背景图片,仅当 type 为 `image` 时有效 - - - - - 按钮上的文本,仅当 type 为 `text` 时有效 - - - - - 背景颜色 - - - - - 边框颜色 - - - - - 边框圆角 - - - - - 边框宽度 - - - - - 文本的颜色。格式为 6 位 16 进制数。 - - - - - 字号 - - - - - 高度 - - - - - 左上角横坐标 - - - - - 文本的行高 - - - - - 文本的水平居中方式 - 可选值: - - 'left': 居左; - - 'center': 居中; - - 'right': 居右; - - - - - 左上角纵坐标 - - - - - 宽度 - - - - - 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 - - - - - 使用像素描述 ImageData 的实际高度 - - - - - 使用像素描述 ImageData 的实际宽度 - - - - - 需要基础库: `2.3.2` - 取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0 - - - - - 是否有新版本 - - - - - 需要解码的视频源文件。基础库 2.13.0 以下的版本只支持本地路径。 2.13.0 开始支持 http:// 和 https:// 协议的远程路径。 - - - - - 需要基础库: `2.15.0` - 是否不需要音频轨道 - - - - - 需要基础库: `2.15.0` - 是否不需要视频轨道 - - - - - 解码模式。0:按 pts 解码;1:以最快速度解码 - - - - - 需要传递的字符串数据,长度需要在 128 之内 - - - - - 需要传递的代表场景的数字,需要在 0 - 50 之间 - - - - - 字体名称 - - - - - 文本的内容 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 字号 - - - - - 字体样式 - 可选值: - - 'normal': 正常; - - 'italic': 斜体; - - - - - 字重 - 可选值: - - 'normal': 正常; - - 'bold': 粗体; - - - - - 接口调用成功的回调函数 - - - - - 需要添加的卡券列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 - - - - - 卡券 ID - - - - - 卡券添加结果列表 - - - - - 卡券的扩展参数,结构请参考下文 - - - - - 用户领取到卡券的 ID - - - - - - 是否成功 - - - - - shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](#) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 经过加密的activityId,解密后可得到原始的activityId。若解密后得到的activityId可以与开发者后台的活动id对应上则验证通过,否则表明valid字段不可靠(被篡改) 详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) - - - - - 错误信息 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 验证是否通过 - - - - - 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/authorize.html#scope-列表) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 是否被添加至 「我的小程序」 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 最多可以选择的图片张数 - - - - - 接口调用失败的回调函数 - - - - - 所选的图片的尺寸 - 可选值: - - 'original': 原图; - - 'compressed': 压缩图; - - - - - 选择图片的来源 - 可选值: - - 'album': 从相册选图; - - 'camera': 使用相机; - - - - - 接口调用成功的回调函数 - - - - - 图片的本地临时文件路径列表 (本地路径) - - - - - 需要基础库: `1.2.0` - 图片的本地临时文件列表 - - - - - 本地临时文件路径 (本地路径) - - - - - 本地临时文件大小,单位 B - - - - - 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 - 可选值: - - 'back': 使用后置摄像头; - - 'front': 使用前置摄像头; - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 最多可以选择的文件个数,基础库2.25.0前,最多可支持9个文件,2.25.0及以后最多可支持20个文件 - - - - - 接口调用失败的回调函数 - - - - - 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。 - - - - - 文件类型 - 可选值: - - 'image': 只能拍摄图片或从相册选择图片; - - 'video': 只能拍摄视频或从相册选择视频; - - 'mix': 可同时选择图片和视频; - - - - - 是否压缩所选文件,基础库2.25.0前仅对 mediaType 为 image 时有效,2.25.0及以后对全量 mediaType 有效 - - - - - 图片和视频选择的来源 - 可选值: - - 'album': 从相册选择; - - 'camera': 使用相机拍摄; - - - - - 接口调用成功的回调函数 - - - - - 本地临时文件列表 - - - - - 文件类型,有效值有 image 、video、mix - - - - - 视频的时间长度 - - - - - 文件类型 - 可选值: - - 'image': 图片; - - 'video': 视频; - - - - - 视频的高度 - - - - - 本地临时文件大小,单位 B - - - - - 本地临时文件路径 (本地路径) - - - - - 视频缩略图临时文件路径 - - - - - 视频的宽度 - - - - - 最多可以选择的文件个数,可以 0~100 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 需要基础库: `2.6.0` - 根据文件拓展名过滤,仅 type==file 时有效。每一项都不能是空字符串。默认不过滤。 - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 所选的文件的类型 - 可选值: - - 'all': 从所有文件选择; - - 'video': 只能选择视频文件; - - 'image': 只能选择图片文件; - - 'file': 可以选择除了图片和视频之外的其它的文件; - - - - - 返回选择的文件的本地临时文件对象数组 - - - - - 选择的文件名称 - - - - - 本地临时文件路径 (本地路径) - - - - - 本地临时文件大小,单位 B - - - - - 选择的文件的会话发送时间,Unix时间戳,工具暂不支持此属性 - - - - - 选择的文件类型 - 可选值: - - 'video': 选择了视频文件; - - 'image': 选择了图片文件; - - 'file': 选择了除图片和视频的文件; - - - - - 蓝牙设备 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 0 | ok | 正常 | - | -1 | already connect | 已连接 | - | 10000 | not init | 未初始化蓝牙适配器 | - | 10001 | not available | 当前蓝牙适配器不可用 | - | 10002 | no device | 没有找到指定设备 | - | 10003 | connection fail | 连接失败 | - | 10004 | no service | 没有找到指定服务 | - | 10005 | no characteristic | 没有找到指定特征 | - | 10006 | no connection | 当前连接已断开 | - | 10007 | property not support | 当前特征不支持此操作 | - | 10008 | system error | 其余所有系统上报的异常 | - | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | - | 10012 | operate time out | 连接超时 | - | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 0 | ok | 正常 | - | -1 | already connect | 已连接 | - | 10000 | not init | 未初始化蓝牙适配器 | - | 10001 | not available | 当前蓝牙适配器不可用 | - | 10002 | no device | 没有找到指定设备 | - | 10003 | connection fail | 连接失败 | - | 10004 | no service | 没有找到指定服务 | - | 10005 | no characteristic | 没有找到指定特征 | - | 10006 | no connection | 当前连接已断开 | - | 10007 | property not support | 当前特征不支持此操作 | - | 10008 | system error | 其余所有系统上报的异常 | - | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | - | 10012 | operate time out | 连接超时 | - | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 图片路径,图片的路径,支持本地路径、代码包路径 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 需要基础库: `2.26.0` - 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放 - - - - - 需要基础库: `2.26.0` - 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。 - - - - - 接口调用失败的回调函数 - - - - - 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)。 - - - - - 接口调用成功的回调函数 - - - - - 压缩后图片的临时文件路径 (本地路径) - - - - - 蓝牙设备 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 超时时间,单位 ms,不填表示不会超时 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - [BLEPeripheralServer](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.html) - 外围设备的服务端。 - - - - - [BLEPeripheralServer.addService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.addService.html) - 需要基础库: `2.10.3` - 添加服务。 - - - - - [BLEPeripheralServer.offCharacteristicReadRequest(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicReadRequest.html) - 需要基础库: `2.10.3` - 移除已连接的设备请求读当前外围设备的特征值事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - BLEPeripheralServer.onCharacteristicReadRequest(listener) - BLEPeripheralServer.offCharacteristicReadRequest(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [BLEPeripheralServer.offCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicSubscribed.html) - 需要基础库: `2.13.0` - 移除特征订阅事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - BLEPeripheralServer.onCharacteristicSubscribed(listener) - BLEPeripheralServer.offCharacteristicSubscribed(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [BLEPeripheralServer.offCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicUnsubscribed.html) - 需要基础库: `2.13.0` - 移除取消特征订阅事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - BLEPeripheralServer.onCharacteristicUnsubscribed(listener) - BLEPeripheralServer.offCharacteristicUnsubscribed(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [BLEPeripheralServer.offCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicWriteRequest.html) - 需要基础库: `2.10.3` - 移除已连接的设备请求写当前外围设备的特征值事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - BLEPeripheralServer.onCharacteristicWriteRequest(listener) - BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [BLEPeripheralServer.onCharacteristicReadRequest(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicReadRequest.html) - 需要基础库: `2.10.3` - 监听已连接的设备请求读当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 - - - - - [BLEPeripheralServer.onCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicSubscribed.html) - 需要基础库: `2.13.0` - 监听特征订阅事件,仅 iOS 支持。 - - - - - [BLEPeripheralServer.onCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicUnsubscribed.html) - 需要基础库: `2.13.0` - 监听取消特征订阅事件,仅 iOS 支持。 - - - - - [BLEPeripheralServer.onCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicWriteRequest.html) - 需要基础库: `2.10.3` - 监听已连接的设备请求写当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 - - - - - [BLEPeripheralServer.removeService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.removeService.html) - 需要基础库: `2.10.3` - 移除服务。 - - - - - [BLEPeripheralServer.startAdvertising(Object Object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.startAdvertising.html) - 需要基础库: `2.10.3` - 开始广播本地创建的外围设备。 - **注意** - - Android 8.0.9 开始,支持直接使用 16/32/128 位 UUID; - - Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](#); - - iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。 - - iOS 同时只能发起一个广播,安卓支持同时发起多个广播。 - - 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。 - - - - - [BLEPeripheralServer.stopAdvertising(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.stopAdvertising.html) - 需要基础库: `2.10.3` - 停止广播。 - - - - - [BLEPeripheralServer.writeCharacteristicValue(Object Object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) - 需要基础库: `2.10.3` - 往指定特征写入二进制数据值,并通知已连接的主机,从机的特征值已发生变化,该接口会处理是走回包还是走订阅。 - - - - - 描述service的Object - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - characteristics列表 - - - - - 蓝牙服务的 UUID - - - - - characteristic 的 UUID - - - - - 描述符数据 - - - - - 特征权限 - - - - - 特征支持的操作 - - - - - 特征对应的二进制值 - - - - - Descriptor 的 UUID - - - - - 描述符的权限 - - - - - 描述符数据 - - - - - 读 - - - - - 写 - - - - - 加密读请求 - - - - - 可读 - - - - - 加密写请求 - - - - - 可写 - - - - - 回包 - - - - - 订阅 - - - - - 读 - - - - - 写 - - - - - 无回复写 - - - - - 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 - - - - - 蓝牙特征的 UUID - - - - - 蓝牙特征对应服务的 UUID - - - - - 蓝牙特征的 UUID - - - - - 蓝牙特征对应服务的 UUID - - - - - 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 - - - - - 蓝牙特征的 UUID - - - - - 蓝牙特征对应服务的 UUID - - - - - 请求写入特征的二进制数据值 - - - - - service 的 UUID - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 广播自定义参数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 广播功率 - 可选值: - - 'low': 功率低; - - 'medium': 功率适中; - - 'high': 功率高; - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.20.1` - 以 beacon 设备形式广播的参数。 - - - - - 当前设备是否可连接 - - - - - 广播中 deviceName 字段,默认为空 - - - - - 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 - - - - - 要广播的服务 UUID 列表。使用 16/32 位 UUID 时请参考注意事项。 - - - - - Beacon 设备的主 ID - - - - - Beacon 设备的次 ID - - - - - Beacon 设备广播的 UUID - - - - - 用于判断距离设备 1 米时 RSSI 大小的参考值 - - - - - 制造商ID,0x 开头的十六进制 - - - - - 制造商信息 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 蓝牙特征的 UUID - - - - - 是否需要通知主机 value 已更新 - - - - - 蓝牙特征对应服务的 UUID - - - - - characteristic 对应的二进制值 - - - - - 可选,处理回包时使用 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 图像像素点数据,每四项表示一个像素点的 RGBA - - - - - 图像高度 - - - - - 图像宽度 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 是否返回当前图像的人脸角度信息 - - - - - 是否返回当前图像的人脸的置信度(可表示器官遮挡情况) - - - - - 是否返回多张人脸的信息 - - - - - 是否返回当前图像的人脸(106 个点) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 - - - - - 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) - - - - - 脸部方框数值,对象包含 height, width, originX, originY 四个属性 (origin 为方框左上角坐标) - - - - - 多人模式(enableMultiFace)下的人脸信息,每个对象包含上述其它属性 - - - - - 标记人脸轮廓的 106 个点位置数组,数组每个对象包含 x 和 y - - - - - 脸部中心点横坐标,检测不到人脸则为 -1 - - - - - 脸部中心点纵坐标,检测不到人脸则为 -1 - - - - - 仰俯角(点头) - - - - - 翻滚角(左右倾) - - - - - 偏航角(摇头) - - - - - 整体可信度 - - - - - 左眼可信度 - - - - - 嘴巴可信度 - - - - - 鼻子可信度 - - - - - 右眼可信度 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 支持的音频输入源列表,可在 [RecorderManager.start()](https://developers.weixin.qq.com/minigame/dev/api/media/recorder/RecorderManager.start.html) 接口中使用。返回值定义参考 https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource - 可选值: - - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; - - 'buildInMic': 手机麦克风,仅限 iOS; - - 'headsetMic': 耳机麦克风,仅限 iOS; - - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; - - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; - - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; - - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; - - - - - 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 - - - - - 蓝牙服务 UUID。需要先调用 [wx.getBLEDeviceServices](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) 获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 设备特征列表 - - - - - 该特征支持的操作类型 - - - - - 蓝牙设备特征的 UUID - - - - - 该特征是否支持 indicate 操作 - - - - - 该特征是否支持 notify 操作 - - - - - 该特征是否支持 read 操作 - - - - - 该特征是否支持 write 操作 - - - - - 该特征是否支持有回复写操作 - - - - - 该特征是否支持无回复写操作 - - - - - 蓝牙设备 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 信号强度,单位 dBm - - - - - 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 设备服务列表 - - - - - 该服务是否为主服务 - - - - - 蓝牙设备服务的 UUID - - - - - 蓝牙设备 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 写模式 (iOS 特有参数) - 可选值: - - 'write': 有回复写; - - 'writeNoResponse': 无回复写; - - - - - 最大传输单元 - - - - - 缓存数据类别,取值为 periodic 或 pre - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 缓存数据 - - - - - 小程序页面路径 - - - - - 传给页面的 query 参数 - - - - - 进入小程序的场景值 - - - - - 客户端拿到缓存数据的时间戳 ms。(iOS 时间戳存在异常,8.0.27 修复) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结果 - - - - - 自定义的登录态 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 是否正在充电中 - - - - - 设备电量,范围 1 - 100 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 0 | ok | 正常 | - | 11000 | unsupport | 系统或设备不支持 | - | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | - | 11002 | location service unavailable | 位置服务不可用 | - | 11003 | already start | 已经开始搜索 | - | 11004 | not startBeaconDiscovery | 还未开始搜索 | - | 11005 | system error | 系统错误 | - | 11006 | invalid data | 参数不正确 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 0 | ok | 正常 | - | 11000 | unsupport | 系统或设备不支持 | - | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | - | 11002 | location service unavailable | 位置服务不可用 | - | 11003 | already start | 已经开始搜索 | - | 11004 | not startBeaconDiscovery | 还未开始搜索 | - | 11005 | system error | 系统错误 | - | 11006 | invalid data | 参数不正确 | - - - - - Beacon 设备列表 - - - - - Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 - - - - - Beacon 设备的主 ID - - - - - Beacon 设备的次 ID - - - - - 表示设备距离的枚举值(仅iOS) - 可选值: - - 0: 信号太弱不足以计算距离,或非 iOS 设备; - - 1: 十分近; - - 2: 比较近; - - 3: 远; - - - - - 表示设备的信号强度,单位 dBm - - - - - Beacon 设备广播的 UUID - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 蓝牙适配器是否可用 - - - - - 是否正在搜索设备 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - UUID 对应的已连接设备列表 - - - - - 当前蓝牙设备的信号强度,单位 dBm - - - - - 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 - - - - - 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 - - - - - 当前蓝牙设备是否可连接( Android 8.0 以下不支持返回该值 ) - - - - - 蓝牙设备 id - - - - - 当前蓝牙设备的广播数据段中的 LocalName 数据段 - - - - - 蓝牙设备名称,某些设备可能没有 - - - - - 当前蓝牙设备的广播数据段中的 ServiceData 数据段 - - - - - 视频号 id,以“sph”开头的id,可在视频号助手获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 需要基础库: `2.29.0` - 结束时间,筛选指定时间段的直播。若上传了startTime,未上传endTime,则endTime默认取当前时间 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.29.0` - 起始时间,筛选指定时间段的直播。若上传了endTime,未上传startTime,则startTime默认为0 - - - - - 接口调用成功的回调函数 - - - - - 直播主题 - - - - - 直播 feedId - - - - - 视频号头像 - - - - - 视频号昵称 - - - - - 直播 nonceId - - - - - 需要基础库: `2.29.0` - 除最近的一条直播外,其他的直播列表(注意:每次最多返回按时间戳增序排列的15个直播信息,其中时间最近的那个直播会在接口其他的返回参数中展示,其余的直播会在该字段中展示)。 - - - - - 需要基础库: `2.29.0` - 直播回放状态 - 可选值: - - 0: 未生成; - - 1: 已生成; - - 3: 生成中; - - 6: 已过期; - - - - - 直播状态 - 可选值: - - 2: 直播中; - - 3: 直播结束; - - - - - 视频号 id,以“sph”开头的id,可在视频号助手获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 直播封面 - - - - - 视频号昵称 - - - - - 预告 id - - - - - 需要基础库: `2.24.6` - 除最近的一条预告信息外,其他的预告信息列表(注意:每次最多返回按时间戳增序排列的15个预告信息,其中时间最近的那个预告信息会在接口其他的返回参数中展示,其余的预告信息会在该字段中展示)。 - - - - - 是否可预约 - - - - - 开始时间 - - - - - 预告状态:0可用 1取消 2已用 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 剪贴板的内容 - - - - - 蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 搜索到的设备列表 - - - - - 用于区分设备的 id - - - - - 蓝牙设备名称,某些设备可能没有 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 第三方平台自定义的数据 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 返回的坐标类型 - 可选值: - - 'wgs84': 返回 gps 坐标; - - 'gcj02': 返回 gcj02 坐标; - - - - - 纬度,范围为 -90~90,负数表示南纬 - - - - - 经度,范围为 -180~180,负数表示西经 - - - - - 需要获取的数据指标的对象数组 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 见type表格说明 - - - - - 部分type需要传,见type表格说明 - - - - - 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 包括 GameClubData 在内的加密数据,详见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 加密算法的初始向量 - - - - - 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.7.0` - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 错误信息 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - AI推理引擎版本 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - - - - - 本机局域网IP地址 - - - - - 本机局域网子网掩码,基础库 2.24.0 开始支持 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.22.1` - 设备是否使用了网络代理 - - - - - 网络类型 - 可选值: - - 'wifi': wifi 网络; - - '2g': 2g 网络; - - '3g': 3g 网络; - - '4g': 4g 网络; - - '5g': 5g 网络; - - 'unknown': Android 下不常见的网络类型; - - 'none': 无网络; - - - - - 信号强弱,单位 dbm - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 是否需要用户授权隐私协议(如果开发者没有在[mp后台-设置-服务内容声明-用户隐私保护指引]中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) - - - - - 隐私授权协议的名称 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 录屏状态 - 可选值: - - 'on': 开启; - - 'off': 关闭; - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.10.1` - 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - - - - - [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - 用户授权结果 - - - - - [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) - 需要基础库: `2.10.1` - 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 - - - - - [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - 在插件中调用时,当前宿主小程序的用户授权结果 - - - - - 订阅消息总开关,true为开启,false为关闭 - - - - - 每一项订阅消息的订阅状态。itemSettings对象的键为**一次性订阅消息的模板id**或**系统订阅消息的类型**,值为'accept'、'reject'、'ban'中的其中一种。'accept'表示用户同意订阅这条消息,'reject'表示用户拒绝订阅这条消息,'ban'表示已被后台封禁。一次性订阅消息使用方法详见 [wx.requestSubscribeMessage](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html),永久订阅消息(仅小游戏可用)使用方法详见[wx.requestSubscribeSystemMessage](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeSystemMessage.html) - ## 注意事项 - - itemSettings 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - - - - - shareTicket - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `1.9.90` - 超时时间,单位 ms - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 当前占用的空间大小, 单位 KB - - - - - 当前 storage 中所有的 key - - - - - 限制的空间大小,单位 KB - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 显示用户信息的语言 - 可选值: - - 'en': 英文; - - 'zh_CN': 简体中文; - - 'zh_TW': 繁体中文; - - - - - 接口调用成功的回调函数 - - - - - 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 - - - - - 需要基础库: `2.7.0` - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - - - - - 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - - - - - 不包括敏感信息的原始数据字符串,用于计算签名 - - - - - 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - [UserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/UserInfo.html) - 用户信息对象,不包含 openid 等敏感信息 - - - - - 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。 - - - - - 用户所在城市。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - - - - - 用户所在国家。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - - - - - 用户性别。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - 可选值: - - 0: 未知; - - 1: 男性; - - 2: 女性; - - - - - 显示 country,province,city 所用的语言。强制返回 “zh_CN”,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - 可选值: - - 'en': 英文; - - 'zh_CN': 简体中文; - - 'zh_TW': 繁体中文; - - - - - 用户昵称 - - - - - 用户所在省份。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) - - - - - 要获取的 key 列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误码 - 可选值: - - -17008: 非法的 key; - - - - - 错误信息 - - - - - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 加密数据,包含互动型托管数据的值。解密后的结果为一个 `KVDataList`,每一项为一个 `KVData`。 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - - - - - 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.7.0` - 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整用户信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html)。解密后得到的数据结构见后文 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.22.1` - 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.11.3` - 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.22.1` - 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 蓝牙设备 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 小游戏内此房间/群聊的 ID。同一时刻传入相同 groupId 的用户会进入到同个实时语音房间。 - - - - - 验证所需的随机字符串 - - - - - 签名,用于验证小游戏的身份 - - - - - 验证所需的时间戳 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.29.0` - 开启后,joinVoIPChat 会同时走 Wi-Fi 和蜂窝网络2种网络模式,保证实时通话体验。 - - - - - 静音设置 - - - - - 房间类型 - 可选值: - - 'voice': 音频房间,用于语音通话; - - 'video': 视频房间,结合 [voip-room](#) 组件可显示成员画面; - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | 当前已在房间内 | | - | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | - | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - | -1000 | 系统错误 | | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | 当前已在房间内 | | - | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | - | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - | -1000 | 系统错误 | | - - - - - 是否静音耳机 - - - - - 是否静音麦克风 - - - - - 错误码 - - - - - 调用结果 - - - - - 在此通话中的成员 openId 名单 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `1.9.90` - 超时时间,单位ms - - - - - 错误信息 - - - - - 需要基础库: `2.24.0` - errno 错误码,错误码的详细说明参考 [Errno错误码](https://developers.weixin.qq.com/minigame/dev/guide/runtime/debug/PublicErrno.html) - - - - - 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 [code2Session](#),使用 code 换取 openid、unionid、session_key 等信息 - - - - - 蓝牙设备 id - - - - - pin 码,Base64 格式。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 超时时间,单位 ms - - - - - 要打开的小程序 appId - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 - 可选值: - - 'develop': 开发版; - - 'trial': 体验版; - - 'release': 正式版; - - - - - 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.24.0` - 不reLaunch目标小程序,直接打开目标跳转的小程序退后台时的页面,需满足以下条件:1. 目标跳转的小程序生命周期未被销毁;2. 且目标当次启动的path、query与上次启动相同,apiCategory以wx.getApiCategory接口的返回结果为准。 - - - - - 打开的页面路径,如果为空则打开首页。path 中 ? 后面的部分会成为 query,在小程序的 `App.onLaunch`、`App.onShow` 和 `Page.onLoad` 的回调函数或小游戏的 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html) 回调函数、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到 query 数据。对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。 - - - - - 需要基础库: `2.18.1` - 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 - - - - - 接口调用成功的回调函数 - - - - - 蓝牙特征的 UUID - - - - - 蓝牙设备 id - - - - - 蓝牙特征对应服务的 UUID - - - - - 是否启用 notify - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.4.0` - 设置特征订阅类型,有效值有 `notification` 和 `indication` - - - - - X 轴 - - - - - Y 轴 - - - - - Z 轴 - - - - - 禁止收藏后长按转发,默认 false - - - - - 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 - - - - - - 收藏标题,不传则默认使用当前小游戏的昵称。 - - - - - 是否处于已连接状态 - - - - - 蓝牙设备 id - - - - - 蓝牙设备 id - - - - - 最大传输单元 - - - - - 连接目前状态 - - - - - 连接状态变化的设备 id - - - - - server 的 UUID - - - - - 缓存数据类别,取值为 periodic 或 pre - - - - - 缓存数据 - - - - - 小游戏页面路径(一般不需要传,除非使用到小游戏独立分包) - - - - - 传给页面的 query 参数 - - - - - 进入小游戏的场景值 - - - - - 客户端拿到缓存数据的时间戳 - - - - - 服务目前是否可用 - - - - - 目前是否处于搜索状态 - - - - - 当前搜寻到的所有 Beacon 设备列表 - - - - - 蓝牙适配器是否可用 - - - - - 蓝牙适配器是否处于搜索状态 - - - - - 新搜索到的设备列表 - - - - - 需要基础库: `2.4.0` - 精度 - - - - - 面对的方向度数 - - - - - 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 - - - - - 当 手机坐标 X/Y 和 地球 X/Y 重合时,绕着 Z 轴转动的夹角为 alpha,范围值为 [0, 2*PI)。逆时针转动为正。 - - - - - 当手机坐标 Y/Z 和地球 Y/Z 重合时,绕着 X 轴转动的夹角为 beta。范围值为 [-1*PI, PI) 。顶部朝着地球表面转动为正。也有可能朝着用户为正。 - - - - - 当手机 X/Z 和地球 X/Z 重合时,绕着 Y 轴转动的夹角为 gamma。范围值为 [-1*PI/2, PI/2)。右边朝着地球表面转动为正。 - - - - - 切换后的屏幕方向。 - 可选值: - - 'landscape': 横屏正方向,以 HOME 键在屏幕右侧为正方向; - - 'landscapeReverse': 横屏反方向,以 HOME 键在屏幕左侧为反方向; - - - - - 错误 - - - - - 错误调用堆栈 - - - - - 需要传递给接力客户端的 query - - - - - 同 Web 规范 KeyEvent code 属性 - - - - - 同 Web 规范 KeyEvent key 属性 - - - - - 事件触发时的时间戳 - - - - - 键盘输入的当前值 - - - - - 键盘高度 - - - - - 内存告警等级,只有 Android 才有,对应系统宏定义 - 可选值: - - 5: TRIM_MEMORY_RUNNING_MODERATE; - - 10: TRIM_MEMORY_RUNNING_LOW; - - 15: TRIM_MEMORY_RUNNING_CRITICAL; - - - - - 按键类型,0左键,1中键,2右键 - - - - - 事件触发时的时间戳 - - - - - 事件触发时鼠标所在的位置横坐标 - - - - - 事件触发时鼠标所在的位置纵坐标 - - - - - 鼠标横坐标偏移量 - - - - - 鼠标纵坐标偏移量 - - - - - 事件触发时的时间戳 - - - - - 事件触发时鼠标所在的位置横坐标 - - - - - 事件触发时鼠标所在的位置纵坐标 - - - - - 当前是否有网络连接 - - - - - 网络类型 - 可选值: - - 'wifi': wifi 网络; - - '2g': 2g 网络; - - '3g': 3g 网络; - - '4g': 4g 网络; - - '5g': 5g 网络; - - 'unknown': Android 下不常见的网络类型; - - 'none': 无网络; - - - - - 当前网络类型 - - - - - 当前是否处于弱网状态 - - - - - 录屏状态 - 可选值: - - 'start': 开始录屏; - - 'stop': 结束录屏; - - - - - 错误信息 - - - - - 是否成功 - - - - - 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。(该图片用于分享到朋友圈的卡片以及从朋友圈转发到会话消息的卡片展示) - - - - - 需要基础库: `2.14.3` - 朋友圈预览图链接,不传则默认使用当前游戏画面截图 - - - - - 需要基础库: `2.14.3` - 审核通过的朋友圈预览图图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - - - - - 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - - - - - 需要基础库: `2.12.2` - 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) - - - - - - 转发标题,不传则默认使用当前小游戏的昵称。 - - - - - 查询参数 - - - - - 当场景为由从另一个小程序或公众号或App打开时,返回此字段 - - - - - 场景值 - - - - - 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 - 可选值: - - 1: 微信联系人单聊; - - 2: 企业微信联系人单聊; - - 3: 普通微信群聊; - - 4: 企业微信互通群聊; - - - - - shareTicket - - - - - 来源小程序或公众号或App的 appId - - - - - 来源小程序传过来的数据,scene=1037或1038时支持 - - - - - 拒绝原因,一般是一个 Error 对象 - - - - - 错误码 - - - - - 调用结果(错误原因) - - - - - 错误码 - - - - - 调用结果 - - - - - 还在实时语音通话中的成员 openId 名单 - - - - - 错误码 - - - - - 调用结果(错误原因) - - - - - 还在实时语音通话中的成员 openId 名单 - - - - - 事件码 - - - - - 附加信息 - - - - - 错误码 - - - - - 调用结果 - - - - - 滚轮 x 轴方向滚动量 - - - - - 滚轮 y 轴方向滚动量 - - - - - 滚轮 z 轴方向滚动量 - - - - - 事件触发时的时间戳 - - - - - 事件触发时鼠标所在的位置横坐标 - - - - - 事件触发时鼠标所在的位置纵坐标 - - - - - 变化后的窗口高度,单位 px - - - - - 变化后的窗口宽度,单位 px - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.10.0` - 蓝牙模式,可作为主/从设备,仅 iOS 需要。 - 可选值: - - 'central': 主机模式; - - 'peripheral': 从机(外围设备)模式; - - - - - 接口调用成功的回调函数 - - - - - 需要打开的卡券列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 卡券 ID - - - - - - 视频 feedId - - - - - 视频号 id,以“sph”开头的id,可在视频号助手获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 活动 id - - - - - 视频号 id,以“sph”开头的id,可在视频号助手获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 视频号 id,以“sph”开头的id,可在视频号助手获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 直播 feedId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) - - - - - 直播 nonceId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) - - - - - 接口调用成功的回调函数 - - - - - 视频号 id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 企业ID - - - - - 客服信息 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 气泡消息图片 - - - - - 气泡消息小程序路径 - - - - - 气泡消息标题 - - - - - 是否发送小程序气泡消息 - - - - - 接口调用成功的回调函数 - - - - - 客服链接 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 会话内消息卡片图片路径 - - - - - 会话内消息卡片路径 - - - - - 会话内消息卡片标题 - - - - - 会话来源。该字段会在进入客服会话时透传给开发者配置好的后台服务。该字段(utf-8编码)最长不得超过 1000 个字节(不是字符串长度),超过将被截断。 - - - - - 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息 - - - - - 接口调用成功的回调函数 - - - - - 在客服会话内点击小程序消息卡片进入小程序时,所带的小程序打开路径 - - - - - 在客服会话内点击小程序消息卡片进入小程序时,所带的小程序打开参数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.10.3` - 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - - - - - [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) - 用户授权结果 - - - - - [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) - 需要基础库: `2.10.3` - 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 对局回放的播放速率,只能设置以下几个值: 0.3, 0.5, 1, 1.5, 2, 2.5, 3.其中1表示元素播放,小于1表示减速播放,大于1表示加速播放 - - - - - 如果原始视频文件中有音频,是否与新传入的bgm混音,默认为false,表示不混音,只保留一个音轨,值为true时表示原始音频与传入的bgm混音 - - - - - 对局回放背景音乐的地址 - - - - - 分享的对局回放打开后的描述内容 - - - - - 分享的对局回放打开后跳转小游戏的 path (独立分包路径) - - - - - 分享的对局回放打开后跳转小游戏的 query - - - - - 对局回放的剪辑区间,是一个二维数组,单位 ms(毫秒)。[[1000, 3000], [4000, 5000]] 表示剪辑已录制对局回放的 1-3 秒和 4-5 秒最终合成为一个 3 秒的对局回放。对局回放剪辑后的总时长最多 60 秒,即 1 分钟 - - - - - 分享的对局回放打开后的标题内容 - - - - - 对局回放的音量大小,最小0,最大1 - - - - - 需要预览的图片链接列表。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持云文件ID。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 当前显示图片的链接 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.13.0` - `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; - - - - - 需要基础库: `2.13.0` - 是否显示长按菜单。 - - - - - 接口调用成功的回调函数 - - - - - 需要预览的资源列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 当前显示的资源序号 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.13.0` - `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; - - - - - 需要基础库: `2.13.0` - 是否显示长按菜单。 - - - - - 接口调用成功的回调函数 - - - - - 图片或视频的地址 - - - - - 视频的封面图片 - - - - - 资源的类型,默认为图片 - 可选值: - - 'image': 图片; - - 'video': 视频; - - - - - 蓝牙特征的 UUID - - - - - 蓝牙设备 id - - - - - 蓝牙特征对应服务的 UUID - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 本地缓存中指定的 key - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 要删除掉 key 列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 场景ID,在「小程序管理后台」获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 此场景的耗时,单位 ms - - - - - 自定义维度数据,key在「小程序管理后台」获取。只支持能够通过JSON.stringify序列化的对象,且序列化后长度不超过1024个字符 - - - - - 接口调用失败的回调函数 - - - - - 自定义指标数据,key在「小程序管理后台」获取。只支持能够通过JSON.stringify序列化的对象,且序列化后长度不超过1024个字符 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误信息 | 说明 | - | - | - | - | ${paramName} should be ${expectType} instead of ${paramType} | 参数的类型需为指定的数据类型 | - | parameter.${paramName} should greater than or equal to zero | 参数的值需要大于等于0 | - | parameter.${paramName}.${key} needs to be a string type and a non-empty string | value仅支持传入非空字符串 | - | parameter.${paramName}.${key} needs to be a numeric value of type string | value仅支持传入纯数值组成的字符串(如:'25') | - | failed to serialize parameter.${paramName} by JSON.stringify | 参数对象序列化失败 | - | parameter.${paramName} cannot exceed 1024 characters | 参数序列化后,字符串长度不可超过1024个字符 | - | report sceneId:${sceneId} repeatedly | 单次启动流程里,场景ID不可重复上报 | - - - - - 错误码 - | 错误信息 | 说明 | - | - | - | - | ${paramName} should be ${expectType} instead of ${paramType} | 参数的类型需为指定的数据类型 | - | parameter.${paramName} should greater than or equal to zero | 参数的值需要大于等于0 | - | parameter.${paramName}.${key} needs to be a string type and a non-empty string | value仅支持传入非空字符串 | - | parameter.${paramName}.${key} needs to be a numeric value of type string | value仅支持传入纯数值组成的字符串(如:'25') | - | failed to serialize parameter.${paramName} by JSON.stringify | 参数对象序列化失败 | - | parameter.${paramName} cannot exceed 1024 characters | 参数序列化后,字符串长度不可超过1024个字符 | - | report sceneId:${sceneId} repeatedly | 单次启动流程里,场景ID不可重复上报 | - - - - - 需要基础库: `2.28.1` - 开发者上报的原始数据 - - - - - 需要基础库: `2.28.1` - 错误信息 - - - - - 需要基础库: `2.28.1` - 开发者上报的原始数据 - - - - - 分支ID,在「小程序管理后台」获取 - - - - - 事件类型,1:曝光; 2:点击 - - - - - 自定义维度,基础库 v2.14.0 开始支持可选 - - - - - 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyQuantity限制说明)。 - - - - - 币种 - 可选值: - - 'CNY': 人民币; - - - - - 环境配置 - 可选值: - - 0: 米大师正式环境; - - 1: 米大师沙箱环境; - - - - - 支付的类型,不同的支付类型有各自额外要传的附加参数 - 可选值: - - 'game': 购买游戏币; - - - - - 随机字符串,长度应小于 128 - - - - - 在米大师侧申请的应用 id - - - - - 开发者业务订单号,每个订单号只能使用一次,重复使用会失败。要求32个字符内,只能是数字、大小写字母、符号 `_-|*@` - - - - - 申请接入时的平台,platform 与应用id有关。 - 可选值: - - 'android': Android平台; - - - - - 签名 - - - - - 生成这个随机字符串的 UNIX 时间戳(精确到秒) - - - - - 分区 ID - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 1000 | | mode错误 | - | -15005 | | 索要权限被封禁(索要功能不可用) | - | -10073011 | | 参数错误(具体错误见errMsg) | - | -10073003 | | outTradeNo业务单号重复 | - | -10073012 | | 索要单已支付 | - | -10073013 | | 索要单已超时 | - | -10073014 | | 签名错误 | - | -10073015 | | 索要功能不可用 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | 1000 | | mode错误 | - | -15005 | | 索要权限被封禁(索要功能不可用) | - | -10073011 | | 参数错误(具体错误见errMsg) | - | -10073003 | | outTradeNo业务单号重复 | - | -10073012 | | 索要单已支付 | - | -10073013 | | 索要单已超时 | - | -10073014 | | 签名错误 | - | -10073015 | | 索要功能不可用 | - - - - - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 错误信息 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 币种 - 可选值: - - 'CNY': 人民币; - - - - - 支付的类型,不同的支付类型有各自额外要传的附加参数。 - 可选值: - - 'game': 购买游戏币; - - - - - 在米大师侧申请的应用 id - - - - - 业务订单号,每个订单号只能使用一次,重复使用会失败。开发者需要确保该订单号在对应游戏下的唯一性,平台会尽可能校验该唯一性约束,但极端情况下可能会跳过对该约束的校验。要求32个字符内,只能是数字、大小写字母、符号_-|*组成,不能以下划线()开头。建议每次调用wx.requestMidasPayment都换新的outTradeNo。若没有传入,则平台会自动填充一个,并以下划线开头 - - - - - 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 环境配置 - 可选值: - - 0: 米大师正式环境; - - 1: 米大师沙箱环境; - - - - - 接口调用失败的回调函数 - - - - - 申请接入时的平台,platform 与应用id有关。 - 可选值: - - 'android': android; - - - - - 接口调用成功的回调函数 - - - - - 分区 ID - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | | 系统失败 | - | -2 | | 支付取消 | - | -15001 | | 虚拟支付接口错误码,缺少参数 | - | -15002 | | 虚拟支付接口错误码,参数不合法 | - | -15003 | | 虚拟支付接口错误码,订单重复 | - | -15004 | | 虚拟支付接口错误码,后台错误 | - | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - | -15007 | | 虚拟支付接口错误码,订单已支付 | - | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | - | 1 | | 虚拟支付接口错误码,用户取消支付 | - | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - | 5 | | 虚拟支付接口错误码,操作系统错误 | - | 6 | | 虚拟支付接口错误码,其他错误 | - | 7 | | 虚拟支付接口错误码,支付取消 | - | 1000 | | 参数错误 | - | 1001 | | 分区未发布 | - | 1003 | | 米大师Portal错误 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | | 系统失败 | - | -2 | | 支付取消 | - | -15001 | | 虚拟支付接口错误码,缺少参数 | - | -15002 | | 虚拟支付接口错误码,参数不合法 | - | -15003 | | 虚拟支付接口错误码,订单重复 | - | -15004 | | 虚拟支付接口错误码,后台错误 | - | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - | -15007 | | 虚拟支付接口错误码,订单已支付 | - | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | - | 1 | | 虚拟支付接口错误码,用户取消支付 | - | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - | 5 | | 虚拟支付接口错误码,操作系统错误 | - | 6 | | 虚拟支付接口错误码,其他错误 | - | 7 | | 虚拟支付接口错误码,支付取消 | - | 1000 | | 参数错误 | - | 1001 | | 分区未发布 | - | 1003 | | 米大师Portal错误 | - - - - - 错误码 - - - - - 错误信息 - - - - - 调用成功信息 - - - - - 需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用失败错误码 - - - - - 接口调用失败错误信息 - - - - - [TEMPLATE_ID]是动态的键,即模板id,值包括'accept'、'reject'、'ban'、'filter'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁,'filter'表示该模板因为模板标题同名被后台过滤。例如 { errMsg: "requestSubscribeMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息 - - - 接口调用成功时errMsg值为'requestSubscribeMessage:ok' - - - - - 系统订阅消息类型列表,一次调用最多可订阅3种类型的消息,目前支持两种类型,"SYS_MSG_TYPE_INTERACTIVE"(好友互动提醒)、"SYS_MSG_TYPE_RANK"(排行榜超越提醒) - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - [MSG_TYPE]是动态的键,即系统订阅消息类型,值为'accept'、'reject'、'ban','accept'表示用户同意订阅该类型对应的模板消息,'reject'表示用户拒绝订阅该类型对应的模板消息,'ban'表示已被后台封禁。例如 { errMsg: "requestSubscribeSystemMessage:ok", SYS_MSG_TYPE_INTERACTIVE: "accept" } 表示用户同意订阅'SYS_MSG_TYPE_INTERACTIVE'这条消息 - - - 接口调用成功时errMsg值为'requestSubscribeSystemMessage:ok' - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 预告 id,通过 getChannelsLiveNoticeInfo 接口获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 打开的页面路径,path 中 ? 后面的部分会成为 query - - - - - 接口调用成功的回调函数 - - - - - 待保存文件路径 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,不支持网络路径 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `1.2.0` - 是否只能从相机扫码,不允许从相册选择图片 - - - - - 需要基础库: `1.7.0` - 扫码类型 - 可选值: - - 'barCode': 一维码; - - 'qrCode': 二维码; - - 'datamatrix': Data Matrix 码; - - 'pdf417': PDF417 条码; - - - - - 接口调用成功的回调函数 - - - - - 所扫码的字符集 - - - - - 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path - - - - - 原始数据,base64编码 - - - - - 所扫码的内容 - - - - - 所扫码的类型 - 可选值: - - 'QR_CODE': 二维码; - - 'AZTEC': 一维码; - - 'CODABAR': 一维码; - - 'CODE_39': 一维码; - - 'CODE_93': 一维码; - - 'CODE_128': 一维码; - - 'DATA_MATRIX': 二维码; - - 'EAN_8': 一维码; - - 'EAN_13': 一维码; - - 'ITF': 一维码; - - 'MAXICODE': 一维码; - - 'PDF_417': 二维码; - - 'RSS_14': 一维码; - - 'RSS_EXPANDED': 一维码; - - 'UPC_A': 一维码; - - 'UPC_E': 一维码; - - 'UPC_EAN_EXTENSION': 一维码; - - 'WX_CODE': 二维码; - - 'CODE_25': 一维码; - - - - - 蓝牙设备 id - - - - - 最大传输单元。设置范围为 (22,512) 区间内,单位 bytes - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 最终协商的 MTU 值。如果协商失败则无此参数。安卓客户端 8.0.9 开始支持。 - - - - - 最终协商的 MTU 值,与传入参数一致。安卓客户端 8.0.9 开始支持。 - - - - - 自定义的登录态 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 剪贴板的内容 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 表示切换为横屏还是竖屏 - 可选值: - - 'landscape': 横屏; - - 'portrait': 竖屏; - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 是否打开调试 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 是否与其他音频混播,设置为 true 之后,不会终止其他应用或微信内的音乐 - - - - - (仅在 iOS 生效)是否遵循静音开关,设置为 false 之后,即使是在静音模式下,也能播放声音 - - - - - true 代表用扬声器播放,false 代表听筒播放,默认值为 true。 - - - - - 接口调用成功的回调函数 - - - - - 是否保持屏幕常亮 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 样式风格 - 可选值: - - 'light': 浅色; - - 'dark': 深色; - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮。在安卓端支持传入特殊值 -1,表示屏幕亮度跟随系统变化 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 样式风格 - 可选值: - - 'white': 白色; - - 'black': 浅色; - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 要修改的 KV 数据列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 数据的 key - - - - - 数据的 value - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 截屏/录屏时的表现,仅支持 none / hidden,传入 hidden 则表示在截屏/录屏时隐藏屏幕 - - - - - 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 - - - - - 需要基础库: `2.4.3` - 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) - - - - - 需要基础库: `2.12.2` - 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) - - - - - - 转发标题,不传则默认使用当前小游戏的昵称。 - - - - - 需要基础库: `2.12.2` - 是否转发到当前群。该参数只对从群工具栏打开的场景下生效,默认转发到当前群,填入false时可转发到其他会话。 - - - - - 按钮的文字数组,数组长度最大为 6 - - - - - 需要基础库: `2.14.0` - 警示文案 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 按钮的文字颜色 - - - - - 接口调用成功的回调函数 - - - - - 用户点击的按钮序号,从上到下的顺序,从0开始 - - - - - 当点击完成时键盘是否收起 - - - - - 键盘右下角 confirm 按钮的类型,只影响按钮的文本内容 - 可选值: - - 'done': 完成; - - 'next': 下一个; - - 'search': 搜索; - - 'go': 前往; - - 'send': 发送; - - - - - 键盘输入框显示的默认值 - - - - - 键盘中文本的最大长度 - - - - - 是否为多行输入 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 提示的内容 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 是否显示透明蒙层,防止触摸穿透 - - - - - 接口调用成功的回调函数 - - - - - 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 - - - - - 取消按钮的文字,最多 4 个字符 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 - - - - - 确认按钮的文字,最多 4 个字符 - - - - - 提示的内容 - - - - - 需要基础库: `2.17.1` - 是否显示输入框 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.17.1` - 显示输入框时的提示文本 - - - - - 是否显示取消按钮 - - - - - 接口调用成功的回调函数 - - - - - 提示的标题 - - - - - 需要基础库: `1.1.0` - 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) - - - - - 为 true 时,表示用户点击了确定按钮 - - - - - editable 为 true 时,用户输入的文本 - - - - - 要分享的图片地址,必须为本地路径或临时路径 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 需要基础库: `3.2.0` - 从消息小程序入口打开小程序的路径,如果当前页面允许分享给朋友,则默认为当前页面路径,否则默认为小程序首页 - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `3.2.0` - 分享的图片消息是否要带小程序入口 - - - - - 需要基础库: `3.2.0` - 分享样式,可选 v2 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.11.3` - 本接口为 Beta 版本,暂只在 Android 平台支持。需要显示的转发按钮名称列表,默认['shareAppMessage']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 - - - - - 接口调用成功的回调函数 - - - - - 是否使用带 shareTicket 的转发[详情](#) - - - - - 提示的内容 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 提示的延迟时间 - - - - - 接口调用失败的回调函数 - - - - - 图标 - 可选值: - - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度; - - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度; - - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度; - - 'none': 不显示图标,此时 title 文本最多可显示两行,[1.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)及以上版本支持; - - - - - 需要基础库: `1.1.0` - 自定义图标的本地路径,image 的优先级高于 icon - - - - - 是否显示透明蒙层,防止触摸穿透 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.1.0` - 监听加速度数据回调函数的执行频率 - 可选值: - - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - - 'normal': 普通的回调频率,在 200ms/次 左右; - - - - - 接口调用成功的回调函数 - - - - - Beacon 设备广播的 UUID 列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 是否校验蓝牙开关,仅在 iOS 下有效。iOS 11 起,控制面板里关掉蓝牙,还是能继续使用 Beacon 服务。 - - - - - 接口调用成功的回调函数 - - - - - 是否允许重复上报同一设备。如果允许重复上报,则 [wx.onBlueToothDeviceFound](#) 方法会多次上报同一设备,但是 RSSI 值会有不同。 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 上报设备的间隔,单位 ms。0 表示找到新设备立即上报,其他数值根据传入的间隔上报。 - - - - - 扫描模式,越高扫描越快,也越耗电。仅安卓微信客户端 7.0.12 及以上支持。 - 可选值: - - 'low': 低; - - 'medium': 中; - - 'high': 高; - - - - - 要搜索的蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID)。某些蓝牙设备会广播自己的主 service 的 UUID。如果设置此参数,则只搜索广播包有对应 UUID 的主服务的蓝牙设备。建议通过该参数过滤掉周边不需要处理的其他蓝牙设备。 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 监听设备方向的变化回调函数的执行频率 - 可选值: - - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; - - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; - - 'normal': 普通的回调频率,在 200ms/次 左右; - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 键盘输入框的当前值 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.4.0` - 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 需要基础库: `2.13.0` - 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/private-message.html) - - - - - 需要基础库: `2.4.0` - 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/updatable-message.html) - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.4.0` - 动态消息的模板信息 - - - - - 需要基础库: `2.11.0` - 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取。详见[群待办消息](#) - - - - - 是否使用带 shareTicket 的转发[详情](#) - - - - - 参数列表 - - - - - 参数名 - - - - - 参数值 - - - - - 静音设置 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.13.0` - 震动强度类型,有效值为:heavy、medium、light - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - 可选值: - - 'style is not support': 当前设备不支持设置震动等级; - - - - - 蓝牙特征的 UUID - - - - - 蓝牙设备 id - - - - - 蓝牙特征对应服务的 UUID - - - - - 蓝牙设备特征对应的二进制值 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 蓝牙特征值的写模式设置,有两种模式,iOS 优先 write,安卓优先 writeNoResponse 。(基础库 2.22.0 开始支持) - 可选值: - - 'write': 强制回复写,不支持时报错; - - 'writeNoResponse': 强制无回复写,不支持时报错; - - - - - 自定义query - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - - - - - 用户是否有直播权限 - - - - - 当前直播状态 - state 合法值: - menuClick 用户点击右上角直播按钮 - start 开始直播 - end 直播结束 - - - - - 当前直播id,只在 state 是 start 时会返回 (基础库v2.19.2开始支持) - - - - - - 是否正在直播 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 最近几场直播的 feedId 列表 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 包括敏感数据在内的完整转发信息的加密数据,详细见加密数据解密算法 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html - - - - - 加密算法的初始向量,详细见加密数据解密算法 - - - - - 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见云调用直接获取开放数据 - - - - - 最近几场直播的 feedId 列表 - - - - - 错误信息 - - - - - 要查询的直播的id - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 支持填写最多4个openid,该用户的直播间将在直播专区置顶显示;可不填 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 用于打开指定游戏内容页面的开放链接 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 支付原串 - - - - - 支付签名 - - - - - 用户态签名 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - 错误信息 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | | 系统失败 | - | -2 | | 支付取消 | - | -15001 | | 虚拟支付接口错误码,缺少参数 | - | -15002 | | 虚拟支付接口错误码,参数不合法 | - | -15003 | | 虚拟支付接口错误码,订单重复 | - | -15004 | | 虚拟支付接口错误码,后台错误 | - | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - | -15007 | | 虚拟支付接口错误码,订单已支付 | - | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | - | 1 | | 虚拟支付接口错误码,用户取消支付 | - | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - | 5 | | 虚拟支付接口错误码,操作系统错误 | - | 6 | | 虚拟支付接口错误码,其他错误 | - | 7 | | 虚拟支付接口错误码,支付取消 | - | 1000 | | 参数错误 | - | 1001 | | 分区未发布 | - | 1003 | | 米大师Portal错误 | - - - - - 错误码 - | 错误码 | 错误信息 | 说明 | - | - | - | - | - | -1 | | 系统失败 | - | -2 | | 支付取消 | - | -15001 | | 虚拟支付接口错误码,缺少参数 | - | -15002 | | 虚拟支付接口错误码,参数不合法 | - | -15003 | | 虚拟支付接口错误码,订单重复 | - | -15004 | | 虚拟支付接口错误码,后台错误 | - | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | - | -15006 | | 虚拟支付接口错误码,货币类型不支持 | - | -15007 | | 虚拟支付接口错误码,订单已支付 | - | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | - | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | - | -15012 | | 虚拟支付接口错误码,小游戏用户态签名错误 | - | -15014 | | 虚拟支付接口错误码,小游戏支付签名错误 | - | -15015 | | sessionkey过期 | - | -15016 | | goodsprice道具价格错误 | - | 1 | | 虚拟支付接口错误码,用户取消支付 | - | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | - | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | - | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | - | 5 | | 虚拟支付接口错误码,操作系统错误 | - | 6 | | 虚拟支付接口错误码,其他错误 | - | 7 | | 虚拟支付接口错误码,支付取消 | - | 1000 | | 参数错误 | - | 1001 | | 分区未发布 | - | 1003 | | 米大师Portal错误 | - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - 接口调用成功的回调函数 - - - - - code - - - - - 错误信息 - - - - - 要打开的业务类型,目前仅支持 'servicecommentpage' - - - - - 调用成功、失败都会执行 - - - - - 评价失败的回调 - - - - - 评价成功的回调 - - - - - 帧数据 - - - - - 帧数据高度 - - - - - 帧原始 dts - - - - - 帧原始 pts - - - - - 帧数据宽度 - - - - - 向开放数据域发送消息 - - 要发送的消息 - - - - [RealtimeLogManager.addFilterMsg(string msg)](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.addFilterMsg.html) - 需要基础库: `2.14.4` - 添加过滤关键字,暂不支持在插件使用 - - - - - [RealtimeLogManager.error()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.error.html) - 需要基础库: `2.14.4` - 写 error 日志,暂不支持在插件使用 - - - - - [RealtimeLogManager.info()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.info.html) - 需要基础库: `2.14.4` - 写 info 日志,暂不支持在插件使用 - - - - - [RealtimeLogManager.setFilterMsg(string msg)](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.setFilterMsg.html) - 需要基础库: `2.14.4` - 设置过滤关键字,暂不支持在插件使用 - - - - - [RealtimeLogManager.warn()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.warn.html) - 需要基础库: `2.14.4` - 写 warn 日志,暂不支持在插件使用 - - - - - 录音分片数据 - - - - - 当前帧是否正常录音结束前的最后一帧 - - - - - 录音分片数据长度 - - - - - 当前帧是否正常录音结束前的最后一帧 - - - - - 录音总时长,单位:ms - - - - - 录音文件大小,单位:Byte - - - - - 录音文件的临时路径 (本地路径) - - - - - 需要基础库: `2.1.0` - 指定录音的音频输入源,可通过 [wx.getAvailableAudioSources()](https://developers.weixin.qq.com/minigame/dev/api/media/audio/wx.getAvailableAudioSources.html) 获取当前可用的音频源 - 可选值: - - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; - - 'buildInMic': 手机麦克风,仅限 iOS; - - 'headsetMic': 有线耳机麦克风,仅限 iOS; - - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; - - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; - - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; - - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; - - - - - 录音的时长,单位 ms,最大值 600000(10 分钟) - - - - - 编码码率,有效值见下表格 - - - - - 音频格式 - 可选值: - - 'mp3': mp3 格式; - - 'aac': aac 格式; - - 'wav': wav 格式; - - 'PCM': pcm 格式; - - - - - 指定帧大小,单位 KB。传入 frameSize 后,每录制指定帧大小的内容后,会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3、pcm 格式。 - - - - - 录音通道数 - 可选值: - - 1: 1 个通道; - - 2: 2 个通道; - - - - - 采样率(pc不支持) - 可选值: - - 8000: 8000 采样率; - - 11025: 11025 采样率; - - 12000: 12000 采样率; - - 16000: 16000 采样率; - - 22050: 22050 采样率; - - 24000: 24000 采样率; - - 32000: 32000 采样率; - - 44100: 44100 采样率; - - 48000: 48000 采样率; - - - - - 激励视频广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/rewarded-video-ad.html - - - - - 加载激励视频广告 - - - - - 监听用户点击 关闭广告 按钮的事件。 - - 用户点击 关闭广告 按钮的事件的回调函数 - - - - 取消监听用户点击 关闭广告 按钮的事件 - - 用户点击 关闭广告 按钮的事件的回调函数 - - - - 上报行为 - 需要基础库: `2.24.5` - - - - - - 获取启动剧情C#侧交互句柄 - - 微信启动剧情交互句柄 - - - - [TCPSocket.bindWifi(Object options)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.bindWifi.html) - 需要基础库: `3.1.1` - 将 TCP Socket 绑定到当前 wifi 网络,成功后会触发 onBindWifi 事件(仅安卓支持) - - - - - [TCPSocket.close()](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.close.html) - 关闭连接 - - - - - [TCPSocket.connect(Object options)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.connect.html) - 在给定的套接字上启动连接 - - - - - [TCPSocket.offBindWifi(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.offBindWifi.html) - 需要基础库: `3.1.1` - 移除当一个 socket 绑定当前 wifi 网络成功时触发该事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - TCPSocket.onBindWifi(listener) - TCPSocket.offBindWifi(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [TCPSocket.offClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.offClose.html) - 移除一旦 socket 完全关闭就发出该事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - TCPSocket.onClose(listener) - TCPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [TCPSocket.offConnect(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.offConnect.html) - 移除当一个 socket 连接成功建立的时候触发该事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - TCPSocket.onConnect(listener) - TCPSocket.offConnect(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [TCPSocket.offError(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.offError.html) - 移除当错误发生时触发的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - TCPSocket.onError(listener) - TCPSocket.offError(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [TCPSocket.offMessage(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.offMessage.html) - 移除当接收到数据的时触发该事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - TCPSocket.onMessage(listener) - TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [TCPSocket.onBindWifi(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.onBindWifi.html) - 需要基础库: `3.1.1` - 监听当一个 socket 绑定当前 wifi 网络成功时触发该事件 - - - - - [TCPSocket.onClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.onClose.html) - 监听一旦 socket 完全关闭就发出该事件 - - - - - [TCPSocket.onConnect(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.onConnect.html) - 监听当一个 socket 连接成功建立的时候触发该事件 - - - - - [TCPSocket.onError(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.onError.html) - 监听当错误发生时触发 - - - - - [TCPSocket.onMessage(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.onMessage.html) - 监听当接收到数据的时触发该事件 - needInfo: 是否需要返回localInfo和remoteInfo,设置为 false 时这两个字段会返回null,设置为 true 会降低性能,请按需使用 - 多次使用OnMessage时needInfo以第一个OnMessage为准,OffMessage()移除所有回调后再次OnMessage可重新设置needInfo - - - - - [TCPSocket.write(string|ArrayBuffer data)](https://developers.weixin.qq.com/minigame/dev/api/network/tcp/TCPSocket.write.html) - 在 socket 上发送数据 - - - - - [UDPSocket.close()](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.close.html) - 关闭 UDP Socket 实例,相当于销毁。 在关闭之后,UDP Socket 实例不能再发送消息,每次调用 `UDPSocket.send` 将会触发错误事件,并且 message 事件回调函数也不会再也执行。在 `UDPSocket` 实例被创建后将被 Native 强引用,保证其不被 GC。在 `UDPSocket.close` 后将解除对其的强引用,让 UDPSocket 实例遵从 GC。 - - - - - [UDPSocket.connect(Object object)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.connect.html) - 需要基础库: `2.15.0` - 预先连接到指定的 IP 和 port,需要配合 write 方法一起使用 - - - - - [UDPSocket.offClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.offClose.html) - 移除关闭事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - UDPSocket.onClose(listener) - UDPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [UDPSocket.offError(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.offError.html) - 移除错误事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - UDPSocket.onError(listener) - UDPSocket.offError(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [UDPSocket.offListening(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.offListening.html) - 移除开始监听数据包消息的事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - UDPSocket.onListening(listener) - UDPSocket.offListening(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [UDPSocket.offMessage(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.offMessage.html) - 移除收到消息的事件的监听函数 - **示例代码** - ```js - const listener = function (res) { console.log(res) } - UDPSocket.onMessage(listener) - UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 - ``` - - - - - [UDPSocket.onClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.onClose.html) - 监听关闭事件 - - - - - [UDPSocket.onError(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.onError.html) - 监听错误事件 - - - - - [UDPSocket.onListening(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.onListening.html) - 监听开始监听数据包消息的事件 - - - - - [UDPSocket.onMessage(function listener)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.onMessage.html) - 监听收到消息的事件 - needInfo: 是否需要返回localInfo和remoteInfo,设置为 false 时这两个字段会返回null,设置为 true 会降低性能,请按需使用 - 多次使用OnMessage时needInfo以第一个OnMessage为准,OffMessage()移除所有回调后再次OnMessage可重新设置needInfo - - - - - [UDPSocket.send(Object object)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.send.html) - 向指定的 IP 和 port 发送消息。基础库 2.9.0 起支持广播 (指定地址为 255.255.255.255)。 - - - - - [UDPSocket.setTTL(number ttl)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.setTTL.html) - 需要基础库: `2.18.0` - 设置 IP_TTL 套接字选项,用于设置一个 IP 数据包传输时允许的最大跳步数 - - - - - [UDPSocket.write()](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.write.html) - 需要基础库: `2.15.0` - 用法与 send 方法相同,如果没有预先调用 connect 则与 send 无差异(注意即使调用了 connect 也需要在本接口填入地址和端口参数) - - - - - [number UDPSocket.bind(number port)](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.bind.html) - 绑定一个系统随机分配的可用端口,或绑定一个指定的端口号 - - - - - [UpdateManager.applyUpdate()](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.applyUpdate.html) - 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。 - **示例代码** - [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - - - - - [UpdateManager.onCheckForUpdate(function listener)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onCheckForUpdate.html) - 监听向微信后台请求检查更新结果事件。微信在小程序每次启动(包括热启动)时自动检查更新,不需由开发者主动触发。 - **示例代码** - [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - - - - - [UpdateManager.onUpdateFailed(function listener)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onUpdateFailed.html) - 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 - **示例代码** - [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - - - - - [UpdateManager.onUpdateReady(function listener)](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.onUpdateReady.html) - 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 - **示例代码** - [示例代码](https://developers.weixin.qq.com/minigame/dev/api/base/update/UpdateManager.html#示例代码) - - - - - 要上传文件资源的路径 (本地路径) - - - - - 文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容 - - - - - 开发者服务器地址 - - - - - 接口调用结束的回调函数(调用成功、失败都会执行) - - - - - 接口调用失败的回调函数 - - - - - HTTP 请求中其他额外的 form data - - - - - HTTP 请求 Header,Header 中不能设置 Referer - - - - - 接口调用成功的回调函数 - - - - - 需要基础库: `2.10.0` - 超时时间,单位为毫秒 - - - - - 开发者服务器返回的数据 - - - - - 开发者服务器返回的 HTTP 状态码 - - - - - 开发者服务器返回的 HTTP Response Header - - - - - 上传进度百分比 - - - - - 预期需要上传的数据总长度,单位 Bytes - - - - - 已经上传的数据长度,单位 Bytes - - - - - 销毁用户信息按钮 - - - - - 隐藏用户信息按钮。 - - - - - 取消监听用户信息按钮的点击事件 - - - - - 监听用户信息按钮的点击事件 - - - - - - 显示用户信息按钮 - - - - - 内部函数,请不要调用 - - - - - - 视频的资源地址 - - - - - 视频的封面 - - - - - 视频的左上角横坐标 - - - - - 视频的左上角纵坐标 - - - - - 视频的宽度 - - - - - 视频的高度 - - - - - Gets a value indicating whether 是否正在播放 - - - - - 播放视频 - - - - - 监听视频播放事件 - - - - - 取消监听视频播放事件,action 为空表示移除全部事件监听 - - - - - 监听视频播放到末尾事件 - - - - - 取消监听视频播放到末尾事件 - - - - - 监听视频错误事件 - - - - - 取消监听视频错误事件,action 为空表示移除全部事件监听 - - - - - 监听视频暂停事件 - - - - - 取消监听视频暂停事件,action 为空表示移除全部事件监听 - - - - - 监听视频由于需要缓冲下一帧而停止时触发 - - - - - 取消监听视频由于需要缓冲下一帧而停止时触发,action 为空表示移除全部事件监听 - - - - - 销毁当前实例 - - - - - 视频退出全屏 - - - - - 暂停 - - - - - 视频全屏 - - 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - - - - 视频跳转 - - 视频跳转到指定位置,单位为 s 秒 - - - - 停止视频 - - - - - 监听视频播放进度更新事件 - - - - - - 取消监听视频播放进度更新事件,action 为空表示移除全部事件监听 - - - - - 监听视频下载(缓冲)事件 - - - - - - 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 - - - - - [Object VideoDecoder.getFrameData()](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.getFrameData.html) - 需要基础库: `2.11.1` - 获取下一帧的解码数据 - - - - - [Promise VideoDecoder.remove()](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.remove.html) - 需要基础库: `2.11.1` - 移除解码器 - - - - - [Promise VideoDecoder.seek(number position)](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.seek.html) - 需要基础库: `2.11.1` - 跳到某个时间点解码 - - - - - [Promise VideoDecoder.start(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.start.html) - 需要基础库: `2.11.1` - 开始解码 - - - - - [Promise VideoDecoder.stop()](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.stop.html) - 需要基础库: `2.11.1` - 停止解码 - - - - - [VideoDecoder.off(string eventName, function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.off.html) - 需要基础库: `2.11.1` - 取消监听录制事件。当对应事件触发时,该回调函数不再执行 - - - - - [VideoDecoder.on(string eventName, function callback)](https://developers.weixin.qq.com/minigame/dev/api/media/video-decoder/VideoDecoder.on.html) - 需要基础库: `2.11.1` - 注册监听录制事件的回调函数。当对应事件触发时,回调函数会被执行 - - - - diff --git a/Runtime/Plugins/wx-runtime-editor.xml.meta b/Runtime/Plugins/wx-runtime-editor.xml.meta deleted file mode 100644 index 4b043917..00000000 --- a/Runtime/Plugins/wx-runtime-editor.xml.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6bf52e9083aa64bd283bc6ef45ac77fa -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index 925cbb93..6db27b73 100644 Binary files a/Runtime/Plugins/wx-runtime.dll and b/Runtime/Plugins/wx-runtime.dll differ diff --git a/Runtime/Plugins/wx-runtime.dll.meta b/Runtime/Plugins/wx-runtime.dll.meta index e482aa2d..1d4eb740 100644 --- a/Runtime/Plugins/wx-runtime.dll.meta +++ b/Runtime/Plugins/wx-runtime.dll.meta @@ -12,11 +12,11 @@ PluginImporter: validateReferences: 1 platformData: - first: - '': Any + : Any second: enabled: 0 settings: - Exclude Editor: 1 + Exclude Editor: 0 Exclude Linux: 1 Exclude Linux64: 1 Exclude LinuxUniversal: 1 @@ -33,7 +33,7 @@ PluginImporter: - first: Editor: Editor second: - enabled: 0 + enabled: 1 settings: CPU: AnyCPU DefaultValueInitialized: true @@ -61,7 +61,7 @@ PluginImporter: second: enabled: 0 settings: - CPU: x86_64 + CPU: None - first: Standalone: LinuxUniversal second: @@ -73,19 +73,19 @@ PluginImporter: second: enabled: 0 settings: - CPU: AnyCPU + CPU: None - first: Standalone: Win second: enabled: 0 settings: - CPU: AnyCPU + CPU: None - first: Standalone: Win64 second: enabled: 0 settings: - CPU: AnyCPU + CPU: None - first: WebGL: WebGL second: diff --git a/Runtime/WxWasmSDKRuntime.asmdef b/Runtime/WxWasmSDKRuntime.asmdef index 525f386b..6b933424 100644 --- a/Runtime/WxWasmSDKRuntime.asmdef +++ b/Runtime/WxWasmSDKRuntime.asmdef @@ -1,9 +1,7 @@ { "name": "Wx", "rootNamespace": "", - "references": [ - "GUID:39e0a8d734341a748a11d45f50641371" - ], + "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false,