HarmonyOS 更新实况窗口疑问?

1、activityId应该如何定义,如果上一个activityId结束后是否可以继续使用这个activityId?

2、如果用户手动取消实况窗,再次通过pusk kit更新会有什么异常,app后台可以=知道该实况窗已取消吗?

3、如果想在右下角展示一个图标,通过descPic没有生效,请问要怎么处理呢,以下是参数。

{
  "event": "TAXI",
"businessUniqueId": "businessUniqueId123",
"data": {
  "payload": {
    "activityId": 18,
    "operation": 0,
    "event": "TAXI",
    "status": "DRIVER_ON_THE_WAY",
    "activityData": {
      "notificationData": {
        "type": 3,
        "contentTitle": "{{status}}",
        "descPic":"topic_two.png",
        "contentText": [
        {
          "text": "距您"
        },
        {
          "text": "1.6公里",
        "foregroundColor": "#FF317AF7"
        },
        {
          "text": " | "
        },
        {
          "text": "6分钟",
        "foregroundColor": "#FF317AF7"
        }
        ],
        "clickAction": {
          "actionType": 1,
          "action": "xxxxxx"
        },
        "richProgress": {
          "type": 0,
          "nodeIcons": [
          "icon1.png",
          "icon2.png",
          "icon3.png"
          ],
          "indicatorIcon": "taxi.png",
          "progress": 40,
          "indicatorType": 1,
          "color": "#FF317AF7",
          "bgColor": "#19000000"
        },
        "extend": {
          "type": 3,
          "pic": "topic_three.png",
          "clickAction": {
            "actionType": 5,
            "data": {
              "tel": "xxx"
            }
          }
        }
      },
      "capsuleData": {
        "type": 1,
        "status": 1,
        "icon": "topic_one.png",
        "bgColor": "#FF317AF7",
        "remind": "EXPAND",
        "title": "接驾中",
        "content": "预计5分钟"
      }
    }
  },
  "pushOptions": {
    "testMessage": true,
    "ttl": 1000,
    "biTag": "biTag"
  }
},
  "aopsId": "xxx",
"platformId": "xxx"
}
阅读 588
1 个回答

问题1:建议每次创建实况窗activityId不同。

1、通过REST API接口场景实况窗,12小时内不允许创建同一个activityId的实况窗。

2、如果采用客户端创建+REST API接口更新的方案,那么上次实况窗结束后还是可以继续使用相同activityId的,但为避免问题2描述的管控情况不建议使用相同activityId。

问题2:如果设备端不存在实况窗,通过REST API接口更新会以回执方式返回155状态码,可通过回执码判断,并且这种情况发送的activityId会被管控24小时,管控期间不可再使用这个activityId创建或更新,若仍继续发送会返回265状态码。

问题3:设置的是进度可视化模板,descPic为强调模板参数,仅notificationData.type为4时生效。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进