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 {
///