using System; using System.Collections.Generic; using UnityEngine.Scripting; namespace WeChatWASM { [Preserve] public class WXJSCallback { public string callbackId; public string type; public string res; } [Preserve] public class AccountInfo { /// /// 小程序帐号信息 /// public MiniProgram miniProgram; /// /// 插件帐号信息(仅在插件中调用时包含这一项) /// public Plugin plugin; } [Preserve] public class MiniProgram { /// /// 小程序 appId /// public string appId; /// /// 需要基础库: `2.10.0` /// 小程序版本 /// 可选值: /// - 'develop': 开发版; /// - 'trial': 体验版; /// - 'release': 正式版; /// public string envVersion; /// /// 需要基础库: `2.10.2` /// 线上小程序版本号 /// public string version; } [Preserve] public class Plugin { /// /// 插件 appId /// public string appId; /// /// 插件版本号 /// public string version; } [Preserve] public class GetBatteryInfoSyncResult { /// /// 是否正在充电中 /// public bool isCharging; /// /// 设备电量,范围 1 - 100 /// public double level; } [Preserve] public class EnterOptionsGame { /// /// 启动小游戏的 query 参数 /// public Dictionary query; /// /// 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) /// public EnterOptionsGameReferrerInfo referrerInfo; /// /// 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/guide/framework/scene.html) /// public double scene; /// /// 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 /// 可选值: /// - 1: 微信联系人单聊; /// - 2: 企业微信联系人单聊; /// - 3: 普通微信群聊; /// - 4: 企业微信互通群聊; /// public double chatType; /// /// shareTicket,详见[获取更多转发信息](#) /// public string shareTicket; } [Preserve] public class EnterOptionsGameReferrerInfo { /// /// 来源小程序、公众号或 App 的 appId /// public string appId; /// /// 来源小程序传过来的数据,scene=1037或1038时支持 /// public Dictionary extraData; /// /// 从小游戏直播间里的挂件入口打开小游戏时,开发者可从启动参数中获取当前直播的直播间Id和直播者openId* /// public GameLiveInfo gameLiveInfo; } [Preserve] public class GameLiveInfo { /// /// 直播者 openId /// public string streamerOpenId; /// /// 直播间 id /// public string feedId; } [Preserve] public class LaunchOptionsGame { /// /// 启动小游戏的 query 参数 /// public Dictionary query; /// /// 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) /// public EnterOptionsGameReferrerInfo referrerInfo; /// /// 启动小游戏的[场景值](https://developers.weixin.qq.com/minigame/dev/devtools/interface/scene.html) /// public double scene; /// /// 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 /// 可选值: /// - 1: 微信联系人单聊; /// - 2: 企业微信联系人单聊; /// - 3: 普通微信群聊; /// - 4: 企业微信互通群聊; /// public double chatType; /// /// shareTicket,详见[获取更多转发信息](#) /// public string shareTicket; } [Preserve] public class ClientRect { /// /// 下边界坐标,单位:px /// public double bottom; /// /// 高度,单位:px /// public double height; /// /// 左边界坐标,单位:px /// public double left; /// /// 右边界坐标,单位:px /// public double right; /// /// 上边界坐标,单位:px /// public double top; /// /// 宽度,单位:px /// public double width; } [Preserve] public class GetStorageInfoSyncOption { /// /// 当前占用的空间大小, 单位 KB /// public double currentSize; /// /// 当前 storage 中所有的 key /// public string[] keys; /// /// 限制的空间大小,单位 KB /// public double limitSize; } [Preserve] public class SystemInfo { /// /// 需要基础库: `1.1.0` /// 客户端基础库版本 /// public string SDKVersion; /// /// 需要基础库: `2.6.0` /// 允许微信使用相册的开关(仅 iOS 有效) /// public bool albumAuthorized; /// /// 需要基础库: `1.8.0` /// 设备性能等级(仅 Android)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) /// public double benchmarkLevel; /// /// 需要基础库: `2.6.0` /// 蓝牙的系统开关 /// public bool bluetoothEnabled; /// /// 需要基础库: `1.5.0` /// 设备品牌 /// public string brand; /// /// 需要基础库: `2.6.0` /// 允许微信使用摄像头的开关 /// public bool cameraAuthorized; /// /// 设备方向 /// 可选值: /// - 'portrait': 竖屏; /// - 'landscape': 横屏; /// public string deviceOrientation; /// /// 需要基础库: `2.15.0` /// 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 /// public bool enableDebug; /// /// 需要基础库: `1.5.0` /// 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 /// public double fontSizeSetting; /// /// 需要基础库: `2.12.3` /// 当前小程序运行的宿主环境 /// public Host host; /// /// 微信设置的语言 /// public string language; /// /// 需要基础库: `2.6.0` /// 允许微信使用定位的开关 /// public bool locationAuthorized; /// /// 需要基础库: `2.6.0` /// 地理位置的系统开关 /// public bool locationEnabled; /// /// `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 /// public bool locationReducedAccuracy; /// /// 需要基础库: `2.6.0` /// 允许微信使用麦克风的开关 /// public bool microphoneAuthorized; /// /// 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 /// public string model; /// /// 需要基础库: `2.6.0` /// 允许微信通知带有提醒的开关(仅 iOS 有效) /// public bool notificationAlertAuthorized; /// /// 需要基础库: `2.6.0` /// 允许微信通知的开关 /// public bool notificationAuthorized; /// /// 需要基础库: `2.6.0` /// 允许微信通知带有标记的开关(仅 iOS 有效) /// public bool notificationBadgeAuthorized; /// /// 需要基础库: `2.6.0` /// 允许微信通知带有声音的开关(仅 iOS 有效) /// public bool notificationSoundAuthorized; /// /// 需要基础库: `2.19.3` /// 允许微信使用日历的开关 /// public bool phoneCalendarAuthorized; /// /// 设备像素比 /// public double pixelRatio; /// /// 客户端平台 /// public string platform; /// /// 需要基础库: `2.7.0` /// 在竖屏正方向下的安全区域 /// public SafeArea safeArea; /// /// 需要基础库: `1.1.0` /// 屏幕高度,单位px /// public double screenHeight; /// /// 需要基础库: `1.1.0` /// 屏幕宽度,单位px /// public double screenWidth; /// /// 需要基础库: `1.9.0` /// 状态栏的高度,单位px /// public double statusBarHeight; /// /// 操作系统及版本 /// public string system; /// /// 微信版本号 /// public string version; /// /// 需要基础库: `2.6.0` /// Wi-Fi 的系统开关 /// public bool wifiEnabled; /// /// 可使用窗口高度,单位px /// public double windowHeight; /// /// 可使用窗口宽度,单位px /// public double windowWidth; /// /// 需要基础库: `2.11.0` /// 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) /// 可选值: /// - 'dark': 深色主题; /// - 'light': 浅色主题; /// public string theme; } [Preserve] public class Host { /// /// 宿主 app 对应的 appId /// public string appId; } [Preserve] public class SafeArea { /// /// 安全区域右下角纵坐标 /// public double bottom; /// /// 安全区域的高度,单位逻辑像素 /// public double height; /// /// 安全区域左上角横坐标 /// public double left; /// /// 安全区域右下角横坐标 /// public double right; /// /// 安全区域左上角纵坐标 /// public double top; /// /// 安全区域的宽度,单位逻辑像素 /// public double width; } [Preserve] public class OnCheckForUpdateCallbackResult { /// /// 是否有新版本 /// public bool hasUpdate; } [Preserve] public class GeneralCallbackResult { /// /// 错误信息 /// public string errMsg; } [Preserve] public class SetMessageToFriendQueryOption { /// /// 需要传递的代表场景的数字,需要在 0 - 50 之间 /// public double shareMessageToFriendScene; } [Preserve] public class GetTextLineHeightOption { /// /// 字体名称 /// public string fontFamily; /// /// 文本的内容 /// public string text; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 字号 /// public double fontSize; /// /// 字体样式 /// 可选值: /// - 'normal': 正常; /// - 'italic': 斜体; /// public string fontStyle; /// /// 字重 /// 可选值: /// - 'normal': 正常; /// - 'bold': 粗体; /// public string fontWeight; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class AddCardOption { /// /// 需要添加的卡券列表 /// public AddCardRequestInfo[] cardList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class AddCardRequestInfo { /// /// 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 /// public string cardExt; /// /// 卡券 ID /// public string cardId; } [Preserve] public class AddCardSuccessCallbackResult { /// /// 卡券添加结果列表 /// public AddCardResponseInfo[] cardList; public string errMsg; } [Preserve] public class AddCardResponseInfo { /// /// 卡券的扩展参数,结构请参考下文 /// public string cardExt; /// /// 用户领取到卡券的 ID /// public string cardId; /// /// 加密 code,为用户领取到卡券的code加密后的字符串,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) /// public string code; /// /// 是否成功 /// public bool isSuccess; } [Preserve] public class AuthPrivateMessageOption { /// /// shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](#) /// public string shareTicket; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class AuthPrivateMessageSuccessCallbackResult { /// /// 经过加密的activityId,解密后可得到原始的activityId。若解密后得到的activityId可以与开发者后台的活动id对应上则验证通过,否则表明valid字段不可靠(被篡改) 详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) /// public string encryptedData; /// /// 错误信息 /// public string errMsg; /// /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string iv; /// /// 验证是否通过 /// public bool valid; } [Preserve] public class AuthorizeOption { /// /// 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/minigame/dev/guide/framework/authorize.html#scope-列表) /// public string scope; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CheckHandoffEnabledOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CheckHandoffEnabledSuccessCallbackResult { /// /// 错误码,0未知,1用户取消,2电脑未登录,3电脑版本过低,4暂未支持 /// public double errCode; /// /// 是否可以进行接力 /// public bool isEnabled; public string errMsg; } [Preserve] public class CheckIsUserAdvisedToRestOption { /// /// 今天已经玩游戏的时间,单位:秒 /// public double todayPlayedTime; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CheckIsUserAdvisedToRestSuccessCallbackResult { /// /// 是否建议用户休息 /// public bool result; public string errMsg; } [Preserve] public class CheckSessionOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ChooseImageOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 最多可以选择的图片张数 /// public double count; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 所选的图片的尺寸 /// 可选值: /// - 'original': 原图; /// - 'compressed': 压缩图; /// public Array sizeType; /// /// 选择图片的来源 /// 可选值: /// - 'album': 从相册选图; /// - 'camera': 使用相机; /// public Array sourceType; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ChooseImageSuccessCallbackResult { /// /// 图片的本地临时文件路径列表 (本地路径) /// public string[] tempFilePaths; /// /// 需要基础库: `1.2.0` /// 图片的本地临时文件列表 /// public ImageFile[] tempFiles; public string errMsg; } [Preserve] public class ImageFile { /// /// 本地临时文件路径 (本地路径) /// public string path; /// /// 本地临时文件大小,单位 B /// public double size; } [Preserve] public class CloseBLEConnectionOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class BluetoothError { /// /// 错误信息 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 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 为空或者是格式不正确 | /// public string errMsg; /// /// 错误码 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 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 为空或者是格式不正确 | /// public double errCode; } [Preserve] public class CloseBluetoothAdapterOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CloseSocketOption { /// /// 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 /// public double code; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 /// public string reason; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CreateBLEConnectionOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 超时时间,单位 ms,不填表示不会超时 /// public double timeout; } [Preserve] public class CreateBLEPeripheralServerOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CreateBLEPeripheralServerSuccessCallbackResult { /// /// [BLEPeripheralServer](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.html) /// 外围设备的服务端。 /// public BLEPeripheralServer server; public string errMsg; } [Preserve] public class BLEPeripheralServer { /// /// [BLEPeripheralServer.addService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.addService.html) /// 需要基础库: `2.10.3` /// 添加服务。 /// public void addService(AddServiceOption option){} /// /// [BLEPeripheralServer.offCharacteristicReadRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicReadRequest.html) /// 需要基础库: `2.10.3` /// 取消监听已连接的设备请求读当前外围设备的特征值事件 /// public void offCharacteristicReadRequest(Action callback){} /// /// [BLEPeripheralServer.offCharacteristicSubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicSubscribed.html) /// 需要基础库: `2.13.0` /// 取消监听特征订阅事件 /// public void offCharacteristicSubscribed(Action callback){} /// /// [BLEPeripheralServer.offCharacteristicUnsubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicUnsubscribed.html) /// 需要基础库: `2.13.0` /// 取消监听取消特征订阅事件 /// public void offCharacteristicUnsubscribed(Action callback){} /// /// [BLEPeripheralServer.offCharacteristicWriteRequest(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicWriteRequest.html) /// 需要基础库: `2.10.3` /// 取消监听已连接的设备请求写当前外围设备的特征值事件 /// public void offCharacteristicWriteRequest(Action callback){} /// /// [BLEPeripheralServer.onCharacteristicReadRequest(function callback)](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) 写回数据,否则主机不会收到响应。 /// public void onCharacteristicReadRequest(Action callback){} /// /// [BLEPeripheralServer.onCharacteristicSubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicSubscribed.html) /// 需要基础库: `2.13.0` /// 监听特征订阅事件,仅 iOS 支持。 /// public void onCharacteristicSubscribed(Action callback){} /// /// [BLEPeripheralServer.onCharacteristicUnsubscribed(function callback)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicUnsubscribed.html) /// 需要基础库: `2.13.0` /// 监听取消特征订阅事件,仅 iOS 支持。 /// public void onCharacteristicUnsubscribed(Action callback){} /// /// [BLEPeripheralServer.onCharacteristicWriteRequest(function callback)](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) 写回数据,否则主机不会收到响应。 /// public void onCharacteristicWriteRequest(Action callback){} /// /// [BLEPeripheralServer.removeService(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.removeService.html) /// 需要基础库: `2.10.3` /// 移除服务。 /// public void removeService(RemoveServiceOption option){} /// /// [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 参数。 /// public void startAdvertising(StartAdvertisingObject Object){} /// /// [BLEPeripheralServer.stopAdvertising(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.stopAdvertising.html) /// 需要基础库: `2.10.3` /// 停止广播。 /// public void stopAdvertising(StopAdvertisingOption option){} /// /// [BLEPeripheralServer.writeCharacteristicValue(Object Object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) /// 需要基础库: `2.10.3` /// 往指定特征写入二进制数据值,并通知已连接的主机,从机的特征值已发生变化,该接口会处理是走回包还是走订阅。 /// public void writeCharacteristicValue(WriteCharacteristicValueObject Object){} } [Preserve] public class AddServiceOption { /// /// 描述service的Object /// public BLEPeripheralService service; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class BLEPeripheralService { /// /// characteristics列表 /// public Characteristic[] characteristics; /// /// 蓝牙服务的 UUID /// public string uuid; } [Preserve] public class Characteristic { /// /// characteristic 的 UUID /// public string uuid; /// /// 描述符数据 /// public Descriptor[] descriptors; /// /// 特征权限 /// public CharacteristicPermission permission; /// /// 特征支持的操作 /// public CharacteristicProperties properties; /// /// 特征对应的二进制值 /// public byte[] value; } [Preserve] public class Descriptor { /// /// Descriptor 的 UUID /// public string uuid; /// /// 描述符的权限 /// public DescriptorPermission permission; /// /// 描述符数据 /// public byte[] value; } [Preserve] public class DescriptorPermission { /// /// 读 /// public bool read; /// /// 写 /// public bool write; } [Preserve] public class CharacteristicPermission { /// /// 加密读请求 /// public bool readEncryptionRequired; /// /// 可读 /// public bool readable; /// /// 加密写请求 /// public bool writeEncryptionRequired; /// /// 可写 /// public bool writeable; } [Preserve] public class CharacteristicProperties { /// /// 回包 /// public bool indicate; /// /// 订阅 /// public bool notify; /// /// 读 /// public bool read; /// /// 写 /// public bool write; /// /// 无回复写 /// public bool writeNoResponse; } [Preserve] public class OnCharacteristicReadRequestCallbackResult { /// /// 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 /// public double callbackId; /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; } [Preserve] public class OnCharacteristicSubscribedCallbackResult { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; } [Preserve] public class OnCharacteristicWriteRequestCallbackResult { /// /// 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 /// public double callbackId; /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// 请求写入特征的二进制数据值 /// public byte[] value; } [Preserve] public class RemoveServiceOption { /// /// service 的 UUID /// public string serviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartAdvertisingObject { /// /// 广播自定义参数 /// public AdvertiseReqObj advertiseRequest; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 广播功率 /// 可选值: /// - 'low': 功率低; /// - 'medium': 功率适中; /// - 'high': 功率高; /// public string powerLevel; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class AdvertiseReqObj { /// /// 需要基础库: `2.20.1` /// 以 beacon 设备形式广播的参数。 /// public BeaconInfoObj beacon; /// /// 当前设备是否可连接 /// public bool connectable; /// /// 广播中 deviceName 字段,默认为空 /// public string deviceName; /// /// 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 /// public ManufacturerData[] manufacturerData; /// /// 要广播的服务 UUID 列表。使用 16/32 位 UUID 时请参考注意事项。 /// public string[] serviceUuids; } [Preserve] public class BeaconInfoObj { /// /// Beacon 设备的主 ID /// public double major; /// /// Beacon 设备的次 ID /// public double minor; /// /// Beacon 设备广播的 UUID /// public string uuid; /// /// 用于判断距离设备 1 米时 RSSI 大小的参考值 /// public double measuredPower; } [Preserve] public class ManufacturerData { /// /// 制造商ID,0x 开头的十六进制 /// public string manufacturerId; /// /// 制造商信息 /// public byte[] manufacturerSpecificData; } [Preserve] public class StopAdvertisingOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class WriteCharacteristicValueObject { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 是否需要通知主机 value 已更新 /// public bool needNotify; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// characteristic 对应的二进制值 /// public byte[] value; /// /// 可选,处理回包时使用 /// public double callbackId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ExitMiniProgramOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ExitVoIPChatOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class FaceDetectOption { /// /// 图像像素点数据,每四项表示一个像素点的 RGBA /// public byte[] frameBuffer; /// /// 图像高度 /// public double height; /// /// 图像宽度 /// public double width; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 是否返回当前图像的人脸角度信息 /// public bool enableAngle; /// /// 是否返回当前图像的人脸的置信度(可表示器官遮挡情况) /// public bool enableConf; /// /// 是否返回多张人脸的信息 /// public bool enableMultiFace; /// /// 是否返回当前图像的人脸(106 个点) /// public bool enablePoint; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class FaceDetectSuccessCallbackResult { /// /// 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 /// public FaceAngel angleArray; /// /// 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) /// public FaceConf confArray; /// /// 脸部正方框数值,对象包含 height, weight, originX, originY 四个属性 /// public Dictionary detectRect; /// /// 多人模式(enableMultiFace)下的人脸信息,每个对象包含上述其它属性 /// public Dictionary faceInfo; /// /// 人脸 106 个点位置数组,数组每个对象包含 x 和 y /// public Dictionary pointArray; /// /// 脸部中心点横坐标,检测不到人脸则为 -1 /// public double x; /// /// 脸部中心点纵坐标,检测不到人脸则为 -1 /// public double y; public string errMsg; } [Preserve] public class FaceAngel { /// /// 仰俯角(点头) /// public double pitch; /// /// 翻滚角(左右倾) /// public double roll; /// /// 偏航角(摇头) /// public double yaw; } [Preserve] public class FaceConf { /// /// 整体可信度 /// public double global; /// /// 左眼可信度 /// public double leftEye; /// /// 嘴巴可信度 /// public double mouth; /// /// 鼻子可信度 /// public double nose; /// /// 右眼可信度 /// public double rightEye; } [Preserve] public class GetAvailableAudioSourcesOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetAvailableAudioSourcesSuccessCallbackResult { /// /// 支持的音频输入源列表,可在 [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; /// public Array audioSources; public string errMsg; } [Preserve] public class GetBLEDeviceCharacteristicsOption { /// /// 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 /// public string deviceId; /// /// 蓝牙服务 UUID。需要先调用 [wx.getBLEDeviceServices](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) 获取 /// public string serviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBLEDeviceCharacteristicsSuccessCallbackResult { /// /// 设备特征列表 /// public BLECharacteristic[] characteristics; public string errMsg; } [Preserve] public class BLECharacteristic { /// /// 该特征支持的操作类型 /// public BLECharacteristicProperties properties; /// /// 蓝牙设备特征的 UUID /// public string uuid; } [Preserve] public class BLECharacteristicProperties { /// /// 该特征是否支持 indicate 操作 /// public bool indicate; /// /// 该特征是否支持 notify 操作 /// public bool notify; /// /// 该特征是否支持 read 操作 /// public bool read; /// /// 该特征是否支持 write 操作 /// public bool write; } [Preserve] public class GetBLEDeviceRSSIOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBLEDeviceRSSISuccessCallbackResult { /// /// 信号强度,单位 dBm /// public double RSSI; public string errMsg; } [Preserve] public class GetBLEDeviceServicesOption { /// /// 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBLEDeviceServicesSuccessCallbackResult { /// /// 设备服务列表 /// public BLEService[] services; public string errMsg; } [Preserve] public class BLEService { /// /// 该服务是否为主服务 /// public bool isPrimary; /// /// 蓝牙设备服务的 UUID /// public string uuid; } [Preserve] public class GetBLEMTUOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 写模式 (iOS 特有参数) /// 可选值: /// - 'write': 有回复写; /// - 'writeNoResponse': 无回复写; /// public string writeType; } [Preserve] public class GetBLEMTUSuccessCallbackResult { /// /// 最大传输单元 /// public double mtu; public string errMsg; } [Preserve] public class GetBatteryInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBatteryInfoSuccessCallbackResult { /// /// 是否正在充电中 /// public bool isCharging; /// /// 设备电量,范围 1 - 100 /// public double level; public string errMsg; } [Preserve] public class GetBeaconsOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class BeaconError { /// /// 错误信息 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 0 | ok | 正常 | /// | 11000 | unsupport | 系统或设备不支持 | /// | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | /// | 11002 | location service unavailable | 位置服务不可用 | /// | 11003 | already start | 已经开始搜索 | /// | 11004 | not startBeaconDiscovery | 还未开始搜索 | /// | 11005 | system error | 系统错误 | /// | 11006 | invalid data | 参数不正确 | /// public string errMsg; /// /// 错误码 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 0 | ok | 正常 | /// | 11000 | unsupport | 系统或设备不支持 | /// | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | /// | 11002 | location service unavailable | 位置服务不可用 | /// | 11003 | already start | 已经开始搜索 | /// | 11004 | not startBeaconDiscovery | 还未开始搜索 | /// | 11005 | system error | 系统错误 | /// | 11006 | invalid data | 参数不正确 | /// public double errCode; } [Preserve] public class GetBeaconsSuccessCallbackResult { /// /// Beacon 设备列表 /// public BeaconInfo[] beacons; public string errMsg; } [Preserve] public class BeaconInfo { /// /// Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 /// public double accuracy; /// /// Beacon 设备的主 ID /// public double major; /// /// Beacon 设备的次 ID /// public double minor; /// /// 表示设备距离的枚举值(仅iOS) /// 可选值: /// - 0: 信号太弱不足以计算距离,或非 iOS 设备; /// - 1: 十分近; /// - 2: 比较近; /// - 3: 远; /// public double proximity; /// /// 表示设备的信号强度,单位 dBm /// public double rssi; /// /// Beacon 设备广播的 UUID /// public string uuid; } [Preserve] public class GetBluetoothAdapterStateOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBluetoothAdapterStateSuccessCallbackResult { /// /// 蓝牙适配器是否可用 /// public bool available; /// /// 是否正在搜索设备 /// public bool discovering; public string errMsg; } [Preserve] public class GetBluetoothDevicesOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetBluetoothDevicesSuccessCallbackResult { /// /// UUID 对应的已连接设备列表 /// public BlueToothDevice[] devices; public string errMsg; } [Preserve] public class BlueToothDevice { /// /// 当前蓝牙设备的信号强度,单位 dBm /// public double RSSI; /// /// 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 /// public byte[] advertisData; /// /// 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 /// public string[] advertisServiceUUIDs; /// /// 蓝牙设备 id /// public string deviceId; /// /// 当前蓝牙设备的广播数据段中的 LocalName 数据段 /// public string localName; /// /// 蓝牙设备名称,某些设备可能没有 /// public string name; /// /// 当前蓝牙设备的广播数据段中的 ServiceData 数据段 /// public Dictionary serviceData; } [Preserve] public class GetChannelsLiveInfoOption { /// /// 视频号 id,以“sph”开头的id,可在视频号助手获取 /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetChannelsLiveInfoSuccessCallbackResult { /// /// 直播主题 /// public string description; /// /// 直播 feedId /// public string feedId; /// /// 视频号头像 /// public string headUrl; /// /// 视频号昵称 /// public string nickname; /// /// 直播 nonceId /// public string nonceId; /// /// 直播状态,2直播中,3直播结束 /// public double status; public string errMsg; } [Preserve] public class GetChannelsLiveNoticeInfoOption { /// /// 视频号 id,以“sph”开头的id,可在视频号助手获取 /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetChannelsLiveNoticeInfoSuccessCallbackResult { /// /// 直播封面 /// public string headUrl; /// /// 视频号昵称 /// public string nickname; /// /// 预告 id /// public string noticeId; /// /// 是否可预约 /// public bool reservable; /// /// 开始时间 /// public string startTime; /// /// 预告状态:0可用 1取消 2已用 /// public double status; public string errMsg; } [Preserve] public class GetClipboardDataOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetClipboardDataSuccessCallbackOption { /// /// 剪贴板的内容 /// public string data; } [Preserve] public class GetConnectedBluetoothDevicesOption { /// /// 蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID) /// public string[] services; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetConnectedBluetoothDevicesSuccessCallbackResult { /// /// 搜索到的设备列表 /// public BluetoothDeviceInfo[] devices; public string errMsg; } [Preserve] public class BluetoothDeviceInfo { /// /// 用于区分设备的 id /// public string deviceId; /// /// 蓝牙设备名称,某些设备可能没有 /// public string name; } [Preserve] public class GetExtConfigOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetExtConfigSuccessCallbackResult { /// /// 第三方平台自定义的数据 /// public Dictionary extConfig; public string errMsg; } [Preserve] public class WxGetFileInfoOption { /// /// 本地文件路径 (本地路径) /// public string filePath; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 计算文件摘要的算法 /// 可选值: /// - 'md5': md5 算法; /// - 'sha1': sha1 算法; /// public string digestAlgorithm; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class WxGetFileInfoSuccessCallbackResult { /// /// 按照传入的 digestAlgorithm 计算得出的的文件摘要 /// public string digest; /// /// 文件大小,以字节为单位 /// public double size; public string errMsg; } [Preserve] public class GetFriendCloudStorageOption { /// /// 要拉取的 key 列表 /// public string[] keyList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetFriendCloudStorageSuccessCallbackResult { /// /// 同玩好友的托管数据 /// public UserGameData[] data; public string errMsg; } [Preserve] public class UserGameData { /// /// 用户的托管 KV 数据列表 /// public KVData[] KVDataList; /// /// 用户的微信头像 url /// public string avatarUrl; /// /// 用户的微信昵称 /// public string nickname; /// /// 用户的 openid /// public string openid; } [Preserve] public class KVData { /// /// 数据的 key /// public string key; /// /// 数据的 value /// public string value; } [Preserve] public class GetGroupCloudStorageOption { /// /// 要拉取的 key 列表 /// public string[] keyList; /// /// 群分享对应的 shareTicket /// public string shareTicket; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetGroupCloudStorageSuccessCallbackResult { /// /// 群同玩成员的托管数据 /// public UserGameData[] data; public string errMsg; } [Preserve] public class GetGroupEnterInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetGroupEnterInfoSuccessCallbackResult { /// /// 需要基础库: `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) /// public string cloudID; /// /// 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string encryptedData; /// /// 错误信息 /// public string errMsg; /// /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string iv; } [Preserve] public class GetGroupInfoOption { /// /// 群 openGId,可通过 `wx.getShareInfo` 获取 /// public string openGId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetGroupInfoSuccessCallbackResult { /// /// 群名称 /// public string name; public string errMsg; } [Preserve] public class GetLocalIPAddressOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetLocalIPAddressSuccessCallbackResult { /// /// 错误信息 /// public string errMsg; /// /// 本机局域网IP地址 /// public string localip; } [Preserve] public class GetLocationOption { /// /// 需要基础库: `1.6.0` /// 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 /// public bool altitude; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.9.0` /// 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 /// public double highAccuracyExpireTime; /// /// 需要基础库: `2.9.0` /// 开启高精度定位 /// public bool isHighAccuracy; /// /// 接口调用成功的回调函数 /// public Action success; /// /// wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 /// public string type; } [Preserve] public class GetLocationSuccessCallbackResult { /// /// 位置的精确度,反应与真实位置之间的接近程度,可以理解成10即与真实位置相差10m,越小越精确 /// public double accuracy; /// /// 需要基础库: `1.2.0` /// 高度,单位 m /// public double altitude; /// /// 需要基础库: `1.2.0` /// 水平精度,单位 m /// public double horizontalAccuracy; /// /// 纬度,范围为 -90~90,负数表示南纬 /// public double latitude; /// /// 经度,范围为 -180~180,负数表示西经 /// public double longitude; /// /// 速度,单位 m/s /// public double speed; /// /// 需要基础库: `1.2.0` /// 垂直精度,单位 m(Android 无法获取,返回 0) /// public double verticalAccuracy; public string errMsg; } [Preserve] public class GetNetworkTypeOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetNetworkTypeSuccessCallbackResult { /// /// 网络类型 /// 可选值: /// - 'wifi': wifi 网络; /// - '2g': 2g 网络; /// - '3g': 3g 网络; /// - '4g': 4g 网络; /// - '5g': 5g 网络; /// - 'unknown': Android 下不常见的网络类型; /// - 'none': 无网络; /// public string networkType; /// /// 信号强弱,单位 dbm /// public double signalStrength; public string errMsg; } [Preserve] public class GetPotentialFriendListOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetPotentialFriendListSuccessCallbackResult { /// /// 可能对游戏感兴趣的未注册好友名单 /// public FriendInfo[] list; public string errMsg; } [Preserve] public class FriendInfo { /// /// 用户的微信头像 url /// public string avatarUrl; /// /// 用户的微信昵称 /// public string nickname; /// /// 用户 openid /// public string openid; } [Preserve] public class GetScreenBrightnessOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetScreenBrightnessSuccessCallbackOption { /// /// 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 /// public double value; } [Preserve] public class GetSettingOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `2.10.1` /// 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 /// public bool withSubscriptions; } [Preserve] public class GetSettingSuccessCallbackResult { /// /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) /// 用户授权结果 /// public AuthSetting authSetting; /// /// [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) /// 需要基础库: `2.10.1` /// 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 /// public SubscriptionsSetting subscriptionsSetting; /// /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) /// 在插件中调用时,当前宿主小程序的用户授权结果 /// public AuthSetting miniprogramAuthSetting; public string errMsg; } [Preserve] public class AuthSetting: Dictionary{ /// /// 是否授权使用你的微信朋友信息,对应开放数据域内的 [wx.getFriendCloudStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getFriendCloudStorage.html) 、[wx.getGroupCloudStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupCloudStorage.html) 、[wx.getGroupInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupInfo.html) 、[wx.getPotentialFriendList](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getPotentialFriendList.html) 、[wx.getUserCloudStorageKeys](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getUserCloudStorageKeys.html) 、[wx.getUserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/OpenDataContext-wx.getUserInfo.html) 、[GameServerManager.getFriendsStateData](https://developers.weixin.qq.com/minigame/dev/api/game-server-manager/GameServerManager.getFriendsStateData.html) 接口,以及主域内的 [wx.getUserInteractiveStorage](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getUserInteractiveStorage.html) 接口。 /// /// scope.WxFriendInteraction /// /// 是否授权用户信息,对应接口 [wx.getUserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/wx.getUserInfo.html) /// /// scope.userInfo /// /// 是否授权地理位置,对应接口 [wx.getLocation](https://developers.weixin.qq.com/minigame/dev/api/location/wx.getLocation.html) /// /// scope.userLocation /// /// 是否授权微信运动步数,对应接口 [wx.getWeRunData](https://developers.weixin.qq.com/minigame/dev/api/open-api/werun/wx.getWeRunData.html) /// /// scope.werun /// /// 是否授权保存到相册,对应接口 [wx.saveImageToPhotosAlbum](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.saveImageToPhotosAlbum.html) /// /// scope.writePhotosAlbum } [Preserve] public class SubscriptionsSetting { /// /// 订阅消息总开关,true为开启,false为关闭 /// public bool mainSwitch; /// /// 每一项订阅消息的订阅状态。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 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 /// public Dictionary itemSettings; } [Preserve] public class GetShareInfoOption { /// /// shareTicket /// public string shareTicket; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `1.9.90` /// 超时时间,单位 ms /// public double timeout; } [Preserve] public class GetStorageInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetStorageInfoSuccessCallbackOption { /// /// 当前占用的空间大小, 单位 KB /// public double currentSize; /// /// 当前 storage 中所有的 key /// public string[] keys; /// /// 限制的空间大小,单位 KB /// public double limitSize; } [Preserve] public class GetSystemInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetSystemInfoAsyncOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserCloudStorageOption { /// /// 要获取的 key 列表 /// public string[] keyList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserCloudStorageSuccessCallbackResult { /// /// 用户托管的 KV 数据列表 /// public KVData[] KVDataList; public string errMsg; } [Preserve] public class GetUserCloudStorageKeysOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserCloudStorageKeysSuccessCallbackResult { /// /// 用户托管数据当中所有的 key 数组 /// public string[] keys; public string errMsg; } [Preserve] public class GetUserInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 显示用户信息的语言 /// 可选值: /// - 'en': 英文; /// - 'zh_CN': 简体中文; /// - 'zh_TW': 繁体中文; /// public string lang; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 /// public bool withCredentials; } [Preserve] public class GetUserInfoSuccessCallbackResult { /// /// 需要基础库: `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) /// public string cloudID; /// /// 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) /// public string encryptedData; /// /// 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) /// public string iv; /// /// 不包括敏感信息的原始数据字符串,用于计算签名 /// public string rawData; /// /// 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string signature; /// /// [UserInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/UserInfo.html) /// 用户信息对象,不包含 openid 等敏感信息 /// public UserInfo userInfo; public string errMsg; } [Preserve] public class UserInfo { /// /// 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。 /// public string avatarUrl; /// /// 用户所在城市。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) /// public string city; /// /// 用户所在国家。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) /// public string country; /// /// 用户性别。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) /// 可选值: /// - 0: 未知; /// - 1: 男性; /// - 2: 女性; /// public double gender; /// /// 显示 country,province,city 所用的语言。强制返回 “zh_CN”,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) /// 可选值: /// - 'en': 英文; /// - 'zh_CN': 简体中文; /// - 'zh_TW': 繁体中文; /// public string language; /// /// 用户昵称 /// public string nickName; /// /// 用户所在省份。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) /// public string province; } [Preserve] public class GetUserInteractiveStorageOption { /// /// 要获取的 key 列表 /// public string[] keyList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserInteractiveStorageFailCallbackResult { /// /// 错误码 /// 可选值: /// - -17008: 非法的 key; /// public double errCode; /// /// 错误信息 /// public string errMsg; } [Preserve] public class GetUserInteractiveStorageSuccessCallbackResult { /// /// 敏感数据对应的云 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) /// public string cloudID; /// /// 加密数据,包含互动型托管数据的值。解密后的结果为一个 `KVDataList`,每一项为一个 `KVData`。 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) /// public string encryptedData; public string errMsg; /// /// 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) /// public string iv; } [Preserve] public class GetWeRunDataOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetWeRunDataSuccessCallbackResult { /// /// 需要基础库: `2.7.0` /// 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) /// public string cloudID; /// /// 包括敏感数据在内的完整用户信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html)。解密后得到的数据结构见后文 /// public string encryptedData; /// /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string iv; public string errMsg; } [Preserve] public class HideKeyboardOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class HideLoadingOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class HideShareMenuOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.11.3` /// 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 /// public string[] menus; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class HideToastOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class InitFaceDetectOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class IsBluetoothDevicePairedOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class JoinVoIPChatOption { /// /// 小游戏内此房间/群聊的 ID。同一时刻传入相同 groupId 的用户会进入到同个实时语音房间。 /// public string groupId; /// /// 验证所需的随机字符串 /// public string nonceStr; /// /// 签名,用于验证小游戏的身份 /// public string signature; /// /// 验证所需的时间戳 /// public long timeStamp; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 静音设置 /// public MuteConfig muteConfig; /// /// 房间类型 /// 可选值: /// - 'voice': 音频房间,用于语音通话; /// - 'video': 视频房间,结合 [voip-room](#) 组件可显示成员画面; /// public string roomType; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class JoinVoIPChatError { /// /// 错误信息 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | -1 | 当前已在房间内 | | /// | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | /// | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | /// | -1000 | 系统错误 | | /// public string errMsg; /// /// 错误码 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | -1 | 当前已在房间内 | | /// | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | /// | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | /// | -1000 | 系统错误 | | /// public double errCode; } [Preserve] public class MuteConfig { /// /// 是否静音耳机 /// public bool muteEarphone; /// /// 是否静音麦克风 /// public bool muteMicrophone; } [Preserve] public class JoinVoIPChatSuccessCallbackResult { /// /// 错误码 /// public double errCode; /// /// 调用结果 /// public string errMsg; /// /// 在此通话中的成员 openId 名单 /// public string[] openIdList; } [Preserve] public class LoginOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `1.9.90` /// 超时时间,单位ms /// public double timeout; } [Preserve] public class LoginSuccessCallbackResult { /// /// 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 [auth.code2Session](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/login/auth.code2Session.html),使用 code 换取 openid、unionid、session_key 等信息 /// public string code; public string errMsg; } [Preserve] public class MakeBluetoothPairOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// pin 码,Base64 格式。 /// public string pin; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 超时时间,单位 ms /// public double timeout; } [Preserve] public class ModifyFriendInteractiveStorageOption { /// /// 需要修改的数据的 key,目前可以为 '1' - '50' /// public string key; /// /// 需要修改的数值,目前只能为 1 /// public double opNum; /// /// 修改类型 /// 可选值: /// - 'add': 加; /// public string operation; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.9.0` /// 分享图片地址,详见 wx.shareMessageToFriend 同名参数(需要配置模板规则) /// public string imageUrl; /// /// 需要基础库: `2.9.0` /// 分享图片 ID,详见 wx.shareMessageToFriend 同名参数(需要配置模板规则) /// public string imageUrlId; /// /// 需要基础库: `2.9.0` /// 是否静默修改(不弹框)。当进入场景是好友 [定向分享](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.shareMessageToFriend.html) 的卡片时有效,代表分享反馈操作,此时 `toUser` 默认为原分享者的 openId /// public bool quiet; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `2.9.0` /// 分享标题,如果设置了这个值,则在交互成功后自动询问用户是否分享给好友(需要配置模板规则) /// public string title; /// /// 目标好友的 openId /// public string toUser; } [Preserve] public class ModifyFriendInteractiveStorageFailCallbackResult { /// /// 错误码 /// 可选值: /// - -17006: 非好友关系; /// - -17007: 非法的 toUser openId; /// - -17008: 非法的 key; /// - -17009: 非法的 operation; /// - -17010: 非法的操作数; /// - -17011: JSServer 校验写操作失败; /// public double errCode; /// /// 错误信息 /// public string errMsg; } [Preserve] public class NavigateToMiniProgramOption { /// /// 要打开的小程序 appId /// public string appId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 /// 可选值: /// - 'develop': 开发版; /// - 'trial': 体验版; /// - 'release': 正式版; /// public string envVersion; /// /// 需要传递给目标小程序的数据,目标小程序可在 `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) 中可以获取到这份数据数据。 /// public Dictionary extraData; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 打开的页面路径,如果为空则打开首页。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"。 /// public string path; /// /// 需要基础库: `2.18.1` /// 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 /// public string shortLink; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class NotifyBLECharacteristicValueChangeOption { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙设备 id /// public string deviceId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// 是否启用 notify /// public bool state; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `2.4.0` /// 设置特征订阅类型,有效值有 `notification` 和 `indication` /// public string type; } [Preserve] public class OnAccelerometerChangeCallbackResult { /// /// X 轴 /// public double x; /// /// Y 轴 /// public double y; /// /// Z 轴 /// public double z; } [Preserve] public class OnAddToFavoritesCallbackResult { /// /// 禁止收藏后长按转发,默认 false /// public bool disableForward; /// /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 /// public string imageUrl; /// /// 查询字符串,必须是 key1=val1&key2=val2 的格式。从收藏进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。 /// public string query; /// /// 收藏标题,不传则默认使用当前小游戏的昵称。 /// public string title; } [Preserve] public class OnBLECharacteristicValueChangeCallbackResult { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙设备 id /// public string deviceId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// 特征最新的值 /// public byte[] value; } [Preserve] public class OnBLEConnectionStateChangeCallbackResult { /// /// 是否处于已连接状态 /// public bool connected; /// /// 蓝牙设备 id /// public string deviceId; } [Preserve] public class OnBLEMTUChangeCallbackResult { /// /// 蓝牙设备 id /// public string deviceId; /// /// 最大传输单元 /// public double mtu; } [Preserve] public class OnBLEPeripheralConnectionStateChangedCallbackResult { /// /// 连接目前状态 /// public bool connected; /// /// 连接状态变化的设备 id /// public string deviceId; /// /// server 的 UUID /// public string serverId; } [Preserve] public class OnBeaconServiceChangeCallbackResult { /// /// 服务目前是否可用 /// public bool available; /// /// 目前是否处于搜索状态 /// public bool discovering; } [Preserve] public class OnBeaconUpdateCallbackResult { /// /// 当前搜寻到的所有 Beacon 设备列表 /// public BeaconInfo[] beacons; } [Preserve] public class OnBluetoothAdapterStateChangeCallbackResult { /// /// 蓝牙适配器是否可用 /// public bool available; /// /// 蓝牙适配器是否处于搜索状态 /// public bool discovering; } [Preserve] public class OnBluetoothDeviceFoundCallbackResult { /// /// 新搜索到的设备列表 /// public BlueToothDevice[] devices; } [Preserve] public class OnCompassChangeCallbackResult { /// /// 需要基础库: `2.4.0` /// 精度 /// public double accuracy; /// /// 面对的方向度数 /// public double direction; } [Preserve] public class OnCopyUrlCallbackResult { /// /// 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 /// public string query; } [Preserve] public class OnDeviceMotionChangeCallbackResult { /// /// 当 手机坐标 X/Y 和 地球 X/Y 重合时,绕着 Z 轴转动的夹角为 alpha,范围值为 [0, 2*PI)。逆时针转动为正。 /// public double alpha; /// /// 当手机坐标 Y/Z 和地球 Y/Z 重合时,绕着 X 轴转动的夹角为 beta。范围值为 [-1*PI, PI) 。顶部朝着地球表面转动为正。也有可能朝着用户为正。 /// public double beta; /// /// 当手机 X/Z 和地球 X/Z 重合时,绕着 Y 轴转动的夹角为 gamma。范围值为 [-1*PI/2, PI/2)。右边朝着地球表面转动为正。 /// public double gamma; } [Preserve] public class OnDeviceOrientationChangeCallbackResult { /// /// 表示切换后的屏幕是横屏还是竖屏 /// 可选值: /// - 'portrait': 竖屏; /// - 'landscape': 横屏正方向,以 HOME 键在屏幕右侧为正方向; /// - 'landscapeReverse': 横屏反方向,以 HOME 键在屏幕左侧为反方向; /// public string value; } [Preserve] public class WxOnErrorCallbackResult { /// /// 错误 /// public string message; /// /// 错误调用堆栈 /// public string stack; } [Preserve] public class OnGyroscopeChangeCallbackResult { /// /// x 轴的角速度 /// public double x; /// /// y 轴的角速度 /// public double y; /// /// z 轴的角速度 /// public double z; } [Preserve] public class OnHandoffCallbackResult { /// /// 需要传递给接力客户端的 query /// public string query; } [Preserve] public class OnKeyDownCallbackResult { /// /// 同 Web 规范 KeyEvent code 属性 /// public string code; /// /// 同 Web 规范 KeyEvent key 属性 /// public string key; /// /// 事件触发时的时间戳 /// public long timeStamp; } [Preserve] public class OnKeyboardInputCallbackResult { /// /// 键盘输入的当前值 /// public string value; } [Preserve] public class OnKeyboardHeightChangeCallbackResult { /// /// 键盘高度 /// public double height; } [Preserve] public class OnMemoryWarningCallbackResult { /// /// 内存告警等级,只有 Android 才有,对应系统宏定义 /// 可选值: /// - 5: TRIM_MEMORY_RUNNING_MODERATE; /// - 10: TRIM_MEMORY_RUNNING_LOW; /// - 15: TRIM_MEMORY_RUNNING_CRITICAL; /// public double level; } [Preserve] public class OnNetworkStatusChangeCallbackResult { /// /// 当前是否有网络连接 /// public bool isConnected; /// /// 网络类型 /// 可选值: /// - 'wifi': wifi 网络; /// - '2g': 2g 网络; /// - '3g': 3g 网络; /// - '4g': 4g 网络; /// - 'unknown': Android 下不常见的网络类型; /// - 'none': 无网络; /// public string networkType; } [Preserve] public class OnNetworkWeakChangeCallbackResult { /// /// 当前网络类型 /// public string networkType; /// /// 当前是否处于弱网状态 /// public bool weakNet; } [Preserve] public class OnShareMessageToFriendCallbackResult { /// /// 错误信息 /// public string errMsg; /// /// 是否成功 /// public bool success; } [Preserve] public class OnShareTimelineCallbackResult { /// /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。(该图片用于分享到朋友圈的卡片以及从朋友圈转发到会话消息的卡片展示) /// public string imageUrl; /// /// 需要基础库: `2.14.3` /// 朋友圈预览图链接,不传则默认使用当前游戏画面截图 /// public string imagePreviewUrl; /// /// 需要基础库: `2.14.3` /// 审核通过的朋友圈预览图图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) /// public string imagePreviewUrlId; /// /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) /// public string imageUrlId; /// /// 需要基础库: `2.12.2` /// 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) /// public string path; /// /// 查询字符串,必须是 key1=val1&key2=val2 的格式。从这条转发消息进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。不传则默认使用当前页面query。 /// public string query; /// /// 转发标题,不传则默认使用当前小游戏的昵称。 /// public string title; } [Preserve] public class OnShowCallbackResult { /// /// 查询参数 /// public Dictionary query; /// /// 当场景为由从另一个小程序或公众号或App打开时,返回此字段 /// public ResultReferrerInfo referrerInfo; /// /// 场景值 /// public double scene; /// /// shareTicket /// public string shareTicket; } [Preserve] public class ResultReferrerInfo { /// /// 来源小程序或公众号或App的 appId /// public string appId; /// /// 来源小程序传过来的数据,scene=1037或1038时支持 /// public Dictionary extraData; } [Preserve] public class SocketTaskOnCloseCallbackResult { /// /// 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 /// public double code; /// /// 一个可读的字符串,表示连接被关闭的原因。 /// public string reason; } [Preserve] public class SocketTaskOnMessageCallbackResult { /// /// 服务器返回的消息 /// public string data; } [Preserve] public class OnSocketOpenCallbackResult { /// /// 需要基础库: `2.0.0` /// 连接成功的 HTTP 响应 Header /// public Dictionary header; } [Preserve] public class OnTouchStartCallbackResult { /// /// 触发此次事件的触摸点列表 /// public Touch[] changedTouches; /// /// 事件触发时的时间戳 /// public long timeStamp; /// /// 当前所有触摸点的列表 /// public Touch[] touches; } [Preserve] public class Touch { /// /// 触点相对于可见视区左边沿的 X 坐标。 /// public float clientX; /// /// 触点相对于可见视区上边沿的 Y 坐标。 /// public float clientY; /// /// 手指挤压触摸平面的压力大小, 从0.0(没有压力)到1.0(最大压力)的浮点数(仅在支持 force touch 的设备返回) /// public double force; /// /// Touch 对象的唯一标识符,只读属性。一次触摸动作(我们值的是手指的触摸)在平面上移动的整个过程中, 该标识符不变。可以根据它来判断跟踪的是否是同一次触摸过程。 /// public int identifier; /// /// 触点相对于页面左边沿的 X 坐标。 /// public float pageX; /// /// 触点相对于页面上边沿的 Y 坐标。 /// public float pageY; } [Preserve] public class OnUnhandledRejectionCallbackResult { /// /// 拒绝原因,一般是一个 Error 对象 /// public string reason; } [Preserve] public class OnVoIPChatInterruptedCallbackResult { /// /// 错误码 /// public double errCode; /// /// 调用结果(错误原因) /// public string errMsg; } [Preserve] public class OnVoIPChatMembersChangedCallbackResult { /// /// 错误码 /// public double errCode; /// /// 调用结果 /// public string errMsg; /// /// 还在实时语音通话中的成员 openId 名单 /// public string[] openIdList; } [Preserve] public class OnVoIPChatSpeakersChangedCallbackResult { /// /// 错误码 /// public double errCode; /// /// 调用结果(错误原因) /// public string errMsg; /// /// 还在实时语音通话中的成员 openId 名单 /// public string[] openIdList; } [Preserve] public class OnVoIPChatStateChangedCallbackResult { /// /// 事件码 /// public double code; /// /// 附加信息 /// public Dictionary data; /// /// 错误码 /// public double errCode; /// /// 调用结果 /// public string errMsg; } [Preserve] public class OnWindowResizeCallbackResult { /// /// 变化后的窗口高度,单位 px /// public double windowHeight; /// /// 变化后的窗口宽度,单位 px /// public double windowWidth; } [Preserve] public class OpenBluetoothAdapterOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.10.0` /// 蓝牙模式,可作为主/从设备,仅 iOS 需要。 /// 可选值: /// - 'central': 主机模式; /// - 'peripheral': 从机(外围设备)模式; /// public string mode; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenCardOption { /// /// 需要打开的卡券列表 /// public OpenCardRequestInfo[] cardList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenCardRequestInfo { /// /// 卡券 ID /// public string cardId; /// /// 由 [wx.addCard](https://developers.weixin.qq.com/minigame/dev/api/open-api/card/wx.addCard.html) 的返回对象中的加密 code 通过解密后得到,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) /// public string code; } [Preserve] public class OpenChannelsActivityOption { /// /// 视频 feedId /// public string feedId; /// /// 视频号 id,以“sph”开头的id,可在视频号助手获取 /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenChannelsEventOption { /// /// 活动 id /// public string eventId; /// /// 视频号 id,以“sph”开头的id,可在视频号助手获取 /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenChannelsLiveOption { /// /// 视频号 id,以“sph”开头的id,可在视频号助手获取 /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 直播 feedId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) /// public string feedId; /// /// 直播 nonceId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) /// public string nonceId; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenChannelsUserProfileOption { /// /// 视频号 id /// public string finderUserName; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenCustomerServiceConversationOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 会话内消息卡片图片路径 /// public string sendMessageImg; /// /// 会话内消息卡片路径 /// public string sendMessagePath; /// /// 会话内消息卡片标题 /// public string sendMessageTitle; /// /// 会话来源 /// public string sessionFrom; /// /// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息 /// public bool showMessageCard; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenSettingOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `2.10.3` /// 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 /// public bool withSubscriptions; } [Preserve] public class OpenSettingSuccessCallbackResult { /// /// [AuthSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/AuthSetting.html) /// 用户授权结果 /// public AuthSetting authSetting; /// /// [SubscriptionsSetting](https://developers.weixin.qq.com/minigame/dev/api/open-api/setting/SubscriptionsSetting.html) /// 需要基础库: `2.10.3` /// 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 /// public SubscriptionsSetting subscriptionsSetting; public string errMsg; } [Preserve] public class PreviewImageOption { /// /// 需要预览的图片链接列表。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持云文件ID。 /// public string[] urls; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 当前显示图片的链接 /// public string current; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.13.0` /// `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; /// public string referrerPolicy; /// /// 需要基础库: `2.13.0` /// 是否显示长按菜单。 /// 支持识别的码:小程序码 /// 仅小程序支持识别的码:微信个人码、微信群码、企业微信个人码、 企业微信群码与企业微信互通群码; /// public bool showmenu; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class PreviewMediaOption { /// /// 需要预览的资源列表 /// public MediaSource[] sources; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 当前显示的资源序号 /// public double current; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.13.0` /// `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; /// public string referrerPolicy; /// /// 需要基础库: `2.13.0` /// 是否显示长按菜单。 /// 支持识别的码:小程序码 /// 仅小程序支持识别的码:微信个人码、微信群码、企业微信个人码、 企业微信群码与企业微信互通群码; /// public bool showmenu; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class MediaSource { /// /// 图片或视频的地址 /// public string url; /// /// 视频的封面图片 /// public string poster; /// /// 资源的类型,默认为图片 /// 可选值: /// - 'image': 图片; /// - 'video': 视频; /// public string type; } [Preserve] public class ReadBLECharacteristicValueOption { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙设备 id /// public string deviceId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class RemoveStorageOption { /// /// 本地缓存中指定的 key /// public string key; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class RemoveUserCloudStorageOption { /// /// 要删除掉 key 列表 /// public string[] keyList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ReportUserBehaviorBranchAnalyticsOption { /// /// 分支ID,在「小程序管理后台」获取 /// public string branchId; /// /// 事件类型,1:曝光; 2:点击 /// public double eventType; /// /// 自定义维度,基础库 v2.14.0 开始支持可选 /// public string branchDim; } [Preserve] public class RequestMidasFriendPaymentOption { /// /// 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyQuantity限制说明)。 /// public double buyQuantity; /// /// 币种 /// 可选值: /// - 'CNY': 人民币; /// public string currencyType; /// /// 环境配置 /// 可选值: /// - 0: 米大师正式环境; /// - 1: 米大师沙箱环境; /// public double env; /// /// 支付的类型,不同的支付类型有各自额外要传的附加参数 /// 可选值: /// - 'game': 购买游戏币; /// public string mode; /// /// 随机字符串,长度应小于 128 /// public string nonceStr; /// /// 在米大师侧申请的应用 id /// public string offerId; /// /// 开发者业务订单号,每个订单号只能使用一次,重复使用会失败。要求32个字符内,只能是数字、大小写字母、符号 `_-|*@` /// public string outTradeNo; /// /// 申请接入时的平台,platform 与应用id有关。 /// 可选值: /// - 'android': Android平台; /// public string platform; /// /// 签名 /// public string signature; /// /// 生成这个随机字符串的 UNIX 时间戳(精确到秒) /// public long timeStamp; /// /// 分区 ID /// public string zoneId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class MidasFriendPaymentError { /// /// 错误信息 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 1000 | | mode错误 | /// | -15005 | | 索要权限被封禁(索要功能不可用) | /// | -10073011 | | 参数错误(具体错误见errMsg) | /// | -10073003 | | outTradeNo业务单号重复 | /// | -10073012 | | 索要单已支付 | /// | -10073013 | | 索要单已超时 | /// | -10073014 | | 签名错误 | /// | -10073015 | | 索要功能不可用 | /// public string errMsg; /// /// 错误码 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | 1000 | | mode错误 | /// | -15005 | | 索要权限被封禁(索要功能不可用) | /// | -10073011 | | 参数错误(具体错误见errMsg) | /// | -10073003 | | outTradeNo业务单号重复 | /// | -10073012 | | 索要单已支付 | /// | -10073013 | | 索要单已超时 | /// | -10073014 | | 签名错误 | /// | -10073015 | | 索要功能不可用 | /// public double errCode; } [Preserve] public class RequestMidasFriendPaymentSuccessCallbackResult { /// /// 敏感数据对应的云 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) /// public string cloudID; /// /// 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string encryptedData; /// /// 错误信息 /// public string errMsg; /// /// 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) /// public string iv; } [Preserve] public class RequestMidasPaymentOption { /// /// 币种 /// 可选值: /// - 'CNY': 人民币; /// public string currencyType; /// /// 支付的类型,不同的支付类型有各自额外要传的附加参数。 /// 可选值: /// - 'game': 购买游戏币; /// public string mode; /// /// 在米大师侧申请的应用 id /// public string offerId; /// /// 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 /// public double buyQuantity; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 环境配置 /// 可选值: /// - 0: 米大师正式环境; /// - 1: 米大师沙箱环境; /// public double env; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 申请接入时的平台,platform 与应用id有关。 /// 可选值: /// - 'android': android; /// public string platform; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 分区 ID /// public string zoneId; } [Preserve] public class MidasPaymentError { /// /// 错误信息 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | -1 | | 系统失败 | /// | -2 | | 支付取消 | /// | -15001 | | 虚拟支付接口错误码,缺少参数 | /// | -15002 | | 虚拟支付接口错误码,参数不合法 | /// | -15003 | | 虚拟支付接口错误码,订单重复 | /// | -15004 | | 虚拟支付接口错误码,后台错误 | /// | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | /// | -15006 | | 虚拟支付接口错误码,货币类型不支持 | /// | -15007 | | 虚拟支付接口错误码,订单已支付 | /// | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | /// | 1 | | 虚拟支付接口错误码,用户取消支付 | /// | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | /// | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | /// | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | /// | 5 | | 虚拟支付接口错误码,操作系统错误 | /// | 6 | | 虚拟支付接口错误码,其他错误 | /// | 1000 | | 参数错误 | /// | 1003 | | 米大师Portal错误 | /// public string errMsg; /// /// 错误码 /// | 错误码 | 错误信息 | 说明 | /// | - | - | - | /// | -1 | | 系统失败 | /// | -2 | | 支付取消 | /// | -15001 | | 虚拟支付接口错误码,缺少参数 | /// | -15002 | | 虚拟支付接口错误码,参数不合法 | /// | -15003 | | 虚拟支付接口错误码,订单重复 | /// | -15004 | | 虚拟支付接口错误码,后台错误 | /// | -15005 | | 虚拟支付接口错误码,appId权限被封禁 | /// | -15006 | | 虚拟支付接口错误码,货币类型不支持 | /// | -15007 | | 虚拟支付接口错误码,订单已支付 | /// | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | /// | 1 | | 虚拟支付接口错误码,用户取消支付 | /// | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | /// | 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay | /// | 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 | /// | 5 | | 虚拟支付接口错误码,操作系统错误 | /// | 6 | | 虚拟支付接口错误码,其他错误 | /// | 1000 | | 参数错误 | /// | 1003 | | 米大师Portal错误 | /// public double errCode; } [Preserve] public class RequestSubscribeMessageOption { /// /// 需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。 /// public string[] tmplIds; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class RequestSubscribeMessageFailCallbackResult { /// /// 接口调用失败错误码 /// public double errCode; /// /// 接口调用失败错误信息 /// public string errMsg; } [Preserve] public class RequestSubscribeMessageSuccessCallbackResult: Dictionary{ /// /// [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' /// public string errMsg; } [Preserve] public class RequestSubscribeSystemMessageOption { /// /// 系统订阅消息类型列表,一次调用最多可订阅3种类型的消息,目前支持两种类型,"SYS_MSG_TYPE_INTERACTIVE"(好友互动提醒)、"SYS_MSG_TYPE_RANK"(排行榜超越提醒) /// public string[] msgTypeList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class RequestSubscribeSystemMessageSuccessCallbackResult: Dictionary{ /// /// [MSG_TYPE]是动态的键,即系统订阅消息类型,值为'accept'、'reject'、'ban','accept'表示用户同意订阅该类型对应的模板消息,'reject'表示用户拒绝订阅该类型对应的模板消息,'ban'表示已被后台封禁。例如 { errMsg: "requestSubscribeSystemMessage:ok", SYS_MSG_TYPE_INTERACTIVE: "accept" } 表示用户同意订阅'SYS_MSG_TYPE_INTERACTIVE'这条消息 /// /// /// 接口调用成功时errMsg值为'requestSubscribeSystemMessage:ok' /// public string errMsg; } [Preserve] public class ReserveChannelsLiveOption { /// /// 预告 id,通过 getChannelsLiveNoticeInfo 接口获取 /// public string noticeId; } [Preserve] public class SaveFileToDiskOption { /// /// 待保存文件路径 /// public string filePath; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SaveImageToPhotosAlbumOption { /// /// 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,不支持网络路径 /// public string filePath; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ScanCodeOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `1.2.0` /// 是否只能从相机扫码,不允许从相册选择图片 /// public bool onlyFromCamera; /// /// 需要基础库: `1.7.0` /// 扫码类型 /// 可选值: /// - 'barCode': 一维码; /// - 'qrCode': 二维码; /// - 'datamatrix': Data Matrix 码; /// - 'pdf417': PDF417 条码; /// public Array scanType; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ScanCodeSuccessCallbackResult { /// /// 所扫码的字符集 /// public string charSet; /// /// 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path /// public string path; /// /// 原始数据,base64编码 /// public string rawData; /// /// 所扫码的内容 /// public string result; /// /// 所扫码的类型 /// 可选值: /// - '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': 一维码; /// public string scanType; public string errMsg; } [Preserve] public class SendSocketMessageOption { /// /// 需要发送的内容 /// public string data; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetBLEMTUOption { /// /// 蓝牙设备 id /// public string deviceId; /// /// 最大传输单元。设置范围为 (22,512) 区间内,单位 bytes /// public double mtu; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetBLEMTUFailCallbackResult { /// /// 最终协商的 MTU 值。如果协商失败则无此参数。安卓客户端 8.0.9 开始支持。 /// public double mtu; } [Preserve] public class SetBLEMTUSuccessCallbackResult { /// /// 最终协商的 MTU 值,与传入参数一致。安卓客户端 8.0.9 开始支持。 /// public double mtu; public string errMsg; } [Preserve] public class SetClipboardDataOption { /// /// 剪贴板的内容 /// public string data; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetEnableDebugOption { /// /// 是否打开调试 /// public bool enableDebug; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetInnerAudioOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 是否与其他音频混播,设置为 true 之后,不会终止其他应用或微信内的音乐 /// public bool mixWithOther; /// /// (仅在 iOS 生效)是否遵循静音开关,设置为 false 之后,即使是在静音模式下,也能播放声音 /// public bool obeyMuteSwitch; /// /// true 代表用扬声器播放,false 代表听筒播放,默认值为 true。 /// public bool speakerOn; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetKeepScreenOnOption { /// /// 是否保持屏幕常亮 /// public bool keepScreenOn; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetMenuStyleOption { /// /// 样式风格 /// 可选值: /// - 'light': 浅色; /// - 'dark': 深色; /// public string style; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetScreenBrightnessOption { /// /// 屏幕亮度值,范围 0 ~ 1。0 最暗,1 最亮 /// public double value; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetStatusBarStyleOption { /// /// 样式风格 /// 可选值: /// - 'white': 白色; /// - 'black': 浅色; /// public string style; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class SetUserCloudStorageOption { /// /// 要修改的 KV 数据列表 /// public KVData[] KVDataList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ShareAppMessageOption { /// /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 /// public string imageUrl; /// /// 需要基础库: `2.4.3` /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) /// public string imageUrlId; /// /// 需要基础库: `2.12.2` /// 独立分包路径。详见 [小游戏独立分包指南](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/independent-sub-packages.html) /// public string path; /// /// 查询字符串,从这条转发消息进入后,可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。必须是 key1=val1&key2=val2 的格式。 /// public string query; /// /// 转发标题,不传则默认使用当前小游戏的昵称。 /// public string title; /// /// 需要基础库: `2.12.2` /// 是否转发到当前群。该参数只对从群工具栏打开的场景下生效,默认转发到当前群,填入false时可转发到其他会话。 /// public bool toCurrentGroup; } [Preserve] public class ShareMessageToFriendOption { /// /// 发送对象的 openId /// public string openId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4 /// public string imageUrl; /// /// 审核通过的图片 ID,详见 [使用审核通过的转发图片](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/share.html#使用审核通过的转发图片) /// public string imageUrlId; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 转发标题,不传则默认使用当前小游戏的昵称。 /// public string title; } [Preserve] public class ShowActionSheetOption { /// /// 按钮的文字数组,数组长度最大为 6 /// public string[] itemList; /// /// 需要基础库: `2.14.0` /// 警示文案 /// public string alertText; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 按钮的文字颜色 /// public string itemColor; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ShowActionSheetSuccessCallbackResult { /// /// 用户点击的按钮序号,从上到下的顺序,从0开始 /// public double tapIndex; public string errMsg; } [Preserve] public class ShowKeyboardOption { /// /// 当点击完成时键盘是否收起 /// public bool confirmHold; /// /// 键盘右下角 confirm 按钮的类型,只影响按钮的文本内容 /// 可选值: /// - 'done': 完成; /// - 'next': 下一个; /// - 'search': 搜索; /// - 'go': 前往; /// - 'send': 发送; /// public string confirmType; /// /// 键盘输入框显示的默认值 /// public string defaultValue; /// /// 键盘中文本的最大长度 /// public double maxLength; /// /// 是否为多行输入 /// public bool multiple; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ShowLoadingOption { /// /// 提示的内容 /// public string title; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 是否显示透明蒙层,防止触摸穿透 /// public bool mask; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ShowModalOption { /// /// 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 /// public string cancelColor; /// /// 取消按钮的文字,最多 4 个字符 /// public string cancelText; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 /// public string confirmColor; /// /// 确认按钮的文字,最多 4 个字符 /// public string confirmText; /// /// 提示的内容 /// public string content; /// /// 需要基础库: `2.17.1` /// 是否显示输入框 /// public bool editable; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.17.1` /// 显示输入框时的提示文本 /// public string placeholderText; /// /// 是否显示取消按钮 /// public bool showCancel; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 提示的标题 /// public string title; } [Preserve] public class ShowModalSuccessCallbackResult { /// /// 需要基础库: `1.1.0` /// 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) /// public bool cancel; /// /// 为 true 时,表示用户点击了确定按钮 /// public bool confirm; /// /// editable 为 true 时,用户输入的文本 /// public string content; public string errMsg; } [Preserve] public class ShowShareImageMenuOption { /// /// 要分享的图片地址,必须为本地路径或临时路径 /// public string path; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class ShowShareMenuOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.11.3` /// 本接口为 Beta 版本,暂只在 Android 平台支持。需要显示的转发按钮名称列表,默认['shareAppMessage']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 /// public string[] menus; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 是否使用带 shareTicket 的转发[详情](#) /// public bool withShareTicket; } [Preserve] public class ShowToastOption { /// /// 提示的内容 /// public string title; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 提示的延迟时间 /// public double duration; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 图标 /// 可选值: /// - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度; /// - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度; /// - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度; /// - 'none': 不显示图标,此时 title 文本最多可显示两行,[1.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)及以上版本支持; /// public string icon; /// /// 需要基础库: `1.1.0` /// 自定义图标的本地路径,image 的优先级高于 icon /// public string image; /// /// 是否显示透明蒙层,防止触摸穿透 /// public bool mask; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartAccelerometerOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.1.0` /// 监听加速度数据回调函数的执行频率 /// 可选值: /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; /// - 'normal': 普通的回调频率,在 200ms/次 左右; /// public string interval; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartBeaconDiscoveryOption { /// /// Beacon 设备广播的 UUID 列表 /// public string[] uuids; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 是否校验蓝牙开关,仅在 iOS 下有效。iOS 11 起,控制面板里关掉蓝牙,还是能继续使用 Beacon 服务。 /// public bool ignoreBluetoothAvailable; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartBluetoothDevicesDiscoveryOption { /// /// 是否允许重复上报同一设备。如果允许重复上报,则 [wx.onBlueToothDeviceFound](#) 方法会多次上报同一设备,但是 RSSI 值会有不同。 /// public bool allowDuplicatesKey; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 上报设备的间隔,单位 ms。0 表示找到新设备立即上报,其他数值根据传入的间隔上报。 /// public double interval; /// /// 扫描模式,越高扫描越快,也越耗电。仅安卓微信客户端 7.0.12 及以上支持。 /// 可选值: /// - 'low': 低; /// - 'medium': 中; /// - 'high': 高; /// public string powerLevel; /// /// 要搜索的蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID)。某些蓝牙设备会广播自己的主 service 的 UUID。如果设置此参数,则只搜索广播包有对应 UUID 的主服务的蓝牙设备。建议通过该参数过滤掉周边不需要处理的其他蓝牙设备。 /// public string[] services; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartCompassOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartDeviceMotionListeningOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 监听设备方向的变化回调函数的执行频率 /// 可选值: /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; /// - 'normal': 普通的回调频率,在 200ms/次 左右; /// public string interval; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartGyroscopeOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 监听陀螺仪数据回调函数的执行频率 /// 可选值: /// - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; /// - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; /// - 'normal': 普通的回调频率,在 200ms/次 左右; /// public string interval; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopAccelerometerOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopBeaconDiscoveryOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopBluetoothDevicesDiscoveryOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopCompassOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopDeviceMotionListeningOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopFaceDetectOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StopGyroscopeOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class UpdateKeyboardOption { /// /// 键盘输入框的当前值 /// public string value; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class UpdateShareMenuOption { /// /// 需要基础库: `2.4.0` /// 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 /// public string activityId; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 需要基础库: `2.13.0` /// 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/private-message.html) /// public bool isPrivateMessage; /// /// 需要基础库: `2.4.0` /// 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/updatable-message.html) /// public bool isUpdatableMessage; /// /// 接口调用成功的回调函数 /// public Action success; /// /// 需要基础库: `2.4.0` /// 动态消息的模板信息 /// public UpdatableMessageFrontEndTemplateInfo templateInfo; /// /// 需要基础库: `2.11.0` /// 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取。详见[群待办消息](#) /// public string toDoActivityId; /// /// 是否使用带 shareTicket 的转发[详情](#) /// public bool withShareTicket; } [Preserve] public class UpdatableMessageFrontEndTemplateInfo { /// /// 参数列表 /// public UpdatableMessageFrontEndParameter[] parameterList; } [Preserve] public class UpdatableMessageFrontEndParameter { /// /// 参数名 /// public string name; /// /// 参数值 /// public string value; } [Preserve] public class UpdateVoIPChatMuteConfigOption { /// /// 静音设置 /// public MuteConfig muteConfig; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class UpdateWeChatAppOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class VibrateLongOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class VibrateShortOption { /// /// 需要基础库: `2.13.0` /// 震动强度类型,有效值为:heavy、medium、light /// public string type; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class WriteBLECharacteristicValueOption { /// /// 蓝牙特征的 UUID /// public string characteristicId; /// /// 蓝牙设备 id /// public string deviceId; /// /// 蓝牙特征对应服务的 UUID /// public string serviceId; /// /// 蓝牙设备特征对应的二进制值 /// public byte[] value; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class StartGameLiveOption { /// /// 自定义query /// public string query; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CheckGameLiveEnabledOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class CheckGameLiveEnabledSuccessCallbackOption { /// /// 错误信息 /// public string errMsg; /// /// 用户是否有直播权限 /// public bool isEnabled; } [Preserve] public class OnGameLiveStateChangeCallbackResult { /// /// 当前直播状态 /// state 合法值: /// menuClick 用户点击右上角直播按钮 /// start 开始直播 /// end 直播结束 /// public string state; /// /// 当前直播id,只在 state 是 start 时会返回 (基础库v2.19.2开始支持) /// public string feedId; } [Preserve] public class OnGameLiveStateChangeCallbackResponse { /// /// 开发者可通过 wx.onGameLiveStateChange 设置观众从直播间打开小游戏的 query 比如:'a=1&b=2' /// public string query; } [Preserve] public class GameLiveState { /// /// 是否正在直播 /// public bool isLive; } [Preserve] public class GetUserCurrentGameliveInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserCurrentGameliveInfoSuccessCallbackOption { /// /// 最近几场直播的 feedId 列表 /// public string[] feedIdList; } [Preserve] public class GetUserRecentGameLiveInfoOption { /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class GetUserGameLiveDetailsSuccessCallbackOption { /// /// 包括敏感数据在内的完整转发信息的加密数据,详细见加密数据解密算法 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html /// public string encryptedData; /// /// 加密算法的初始向量,详细见加密数据解密算法 /// public string iv; /// /// 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见云调用直接获取开放数据 /// public string cloudID; /// /// 最近几场直播的 feedId 列表 /// public string[] feedIdList; /// /// 错误信息 /// public string errMsg; } [Preserve] public class GetUserGameLiveDetailsOption { /// /// 要查询的直播的id /// public string[] feedIdList; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class OpenChannelsLiveCollectionOption { /// /// 支持填写最多4个openid,该用户的直播间将在直播专区置顶显示;可不填 /// public string[] openIds; /// /// 接口调用结束的回调函数(调用成功、失败都会执行) /// public Action complete; /// /// 接口调用失败的回调函数 /// public Action fail; /// /// 接口调用成功的回调函数 /// public Action success; } [Preserve] public class UpdateManager{ private string instanceId; public UpdateManager(string id) { instanceId = id; } /// /// [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#示例代码) /// public void ApplyUpdate(){ WXSDKManagerHandler.Instance.ApplyUpdate(instanceId); } /// /// [UpdateManager.onCheckForUpdate(function callback)](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#示例代码) /// public void OnCheckForUpdate(Action callback){ WXSDKManagerHandler.Instance.OnCheckForUpdate(instanceId, callback); } /// /// [UpdateManager.onUpdateFailed(function callback)](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#示例代码) /// public void OnUpdateFailed(Action callback){ WXSDKManagerHandler.Instance.OnUpdateFailed(instanceId, callback); } /// /// [UpdateManager.onUpdateReady(function callback)](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#示例代码) /// public void OnUpdateReady(Action callback){ WXSDKManagerHandler.Instance.OnUpdateReady(instanceId, callback); } } }