MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 快速上手
  • Basic 基础

    • canlUse 版本可用性
    • log 打印日志
    • getSystemInfo 获取系统信息
    • fireGlobalEvent 发送全局通知
      • addEventListener 监听 app 事件
      • getPluginInfo 获取插件路径
      • interfaceForThirdParty 调用第三方sdk方法
      • scanForPlugins 插件页面的扫一扫
      • getDiablomode 获取当前是否是暗黑模式
    • Account

    • UI 界面

    • Device 设备

    • Bluetooth 蓝牙

    • Wifi WiFi

    • HomeManage 家庭管理

    • RoomManage 房间管理

    • Media 媒体

    • Location 定位

    • Encryption 加/解密

    • FileStorage 文件/存储

    • Http 网络/请求

    • weather 天气信息

    • Siri

    • TelPhone

    请扫码查看示例

    # fireGlobalEvent ^7.8

    发送全局通知,通过 addEventListener 方法来异步接收消息

    # 请求参数

    Prop Type Comment
    event String 事件名
    param Object 传送的数据

    # 引入接口模块

    import bridge from '@minix-iot/etsbridge-sdk'
    
    1

    # 入参代码示例

    let params = {
      event: 'xxx', //事件名 自定义
      param: {
        messageType: '', // stringH5用来判断消息类型,然后做相对应的处理
        messageBody: {}, //传递的json对象
      },
    }
    
    1
    2
    3
    4
    5
    6
    7

    # 接口调用示例

    // 监听
    bridge.addEventListener('receiveMessageFromApp', (res) => {
      // res.messageType:消息类型
      // res.messageBody: 原生返回的json数据。
      console.log(res)
    })
    let params = {
      event: 'receiveMessageFromApp', //事件名,
      param: {
        messageType: 'test', // stringH5用来判断消息类型,然后做相对应的处理
        messageBody: {
          test: 'woshishui',
        }, //传递的json对象
      },
    }
    // 触发
    bridge.fireGlobalEvent(params).then((res) => {
      console.log(res)
    })
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    # 返回参数

    • 成功时返回 N/A

    # 返回示例

    {
      "code":0,
      "msg": 'xxx'
    }
    
    1
    2
    3
    4