有信开发指南

应用菜单接入

接入

在使用应用消息服务前,如果需要接入应用菜单。需要提供以下数据内容

  • appId:应用ID
  • content:菜单显示名称
  • action: 菜单操作(打开的URL地址)
  • operationType:菜单选项类型(1返回页面,2返回一个格式如下的JSON)
  • sort:菜单顺序(1 返回)
  • operationList:子选项数组(可选)

接入结构

  • 应用需要提供的配置项为:
      "operationList": [
          {
              "appId": "2",           //应用ID
              "content": "一级选项1",   //选项显示名称
              "action": "",           //选项操作
              "operationType": "1",   //选项类型
              "sort": 1,              //选项顺序
              "operationList": [      //选项的子选项
                  {
                      "appId": "2",
                      "content": "子项1",
                      "action": "URL地址",
                      "operationType": "1",
                      "sort": 1,
                      "operationList": null
                  }
              ]
          },
          {
              "appId": "2",
              "content": "一级选项2",
              "action": "http://xxx",
              "operationType": "1",
              "sort": 2,
              "operationList": []
          }
      ]
    
  • 说明:operationType为2时,返回的JSON类型
    {
      "succeed":true,   // 返回操作成功
      "code":-1,            // 错误代码
      "data":true,          // 返回值
      "msg":"描述"       // 描述信息
    }