Updated on 2023-03-27 GMT+08:00

Subscribing to Skill Messages

After you subscribe to messages for a specified skill, the subscription object (recipient) will receive an email or SMS notification when the skill has any output.

For example, assume that a skill has the function of detecting strangers and sending messages, that is, the skill's Product Description on the skill details page contains "This skill supports notification messages". Then, after you install the skill and subscribe to a message topic (Configuring Subscription Objects), the configured subscription object will receive an email or SMS notification when the device detects a stranger.

Precautions

  • When subscribing to a message for the first time, restart the skill so that the subscription object can receive the message. For details about how to restart the skill, see Starting or Stopping Skills.

Prerequisites

  • The skill supports the message notification function. This function is configured during skill development. For details about the guide and APIs, see the HiLens Developer Guide.

    If the message notification function is not configured for a skill, common users cannot receive notification messages from the skill.

  • The skill has been deployed on a device and is in the Running state. Users cannot receive notification messages from a skill not in the Running state.

Configuring Subscription Objects

A subscription object is the recipient of notification messages. When the device detects a specified scenario (for example, a stranger detection skill installed on the device detects a stranger), the subscription object can receive a notification message.

  1. Log in to the Huawei HiLens console, choose Device Management > Devices in the navigation pane. The device list page is displayed.
  2. Click the card of the device where the skill is installed. The Skill Management page is displayed by default.
    Figure 1 Accessing the device details page
  3. Click the name of the skill for which you want to configure a subscription object. The skill details page is displayed.
  4. Click the Skill Messages tab.
    Figure 2 Skill message
  5. Set the Current Skill Topic.
    • To add a new topic:
      1. Click on the right of Existing Topics. In the text box that is displayed, enter a topic name, which contains a maximum of 255 characters, starting with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. Then, click .
      2. Click on the right of the topic. In the dialog box that is displayed, click OK to confirm the skill topic setting.
    • To add an existing topic:

      Click on the right of an existing topic. In the dialog box that is displayed, click OK to confirm the skill topic setting.

  6. Click Back to Skill Messages in the upper right corner of the Skill Messages tab to configure the message recipient of the current skill topic.
    Figure 3 Back to Skill Messages
  7. Click on the right of the subscription list. The Message Management dialog box is displayed.
    Figure 4 Message recipients
  8. Edit the message recipients of the current topic as follows:
    • To add a new recipient:

      Click Add Message Recipient and enter recipient information in the text boxes that are displayed. For details about the parameters, see Table 1. Confirm the information and click .

    • To edit an existing recipient:
      Click on the right of a message recipient and re-enter the recipient information in the text boxes. For details about the parameters, see Table 1. Confirm the information and click .
      Table 1 Message recipient parameters

      Parameter

      Description

      Recipient

      Name of the subscription object

      Receiving Mode

      Message receiving mode. The options are Email and Text message.

      Mobile Number/Email Address

      Mobile number or email address used for receiving messages

    You can click Set to Default to set the default recipient for quick subscription. (You can click on the right of the subscription list in step 4 to perform quick subscription.)

  9. Click to select the recipient who subscribes to the skill, and click OK.

    The subscription list is displayed. You can view the added recipient.

    To add multiple message recipients, go to step 7.

    Figure 5 Subscription list
  10. After the message recipient is added, the recipient will receive a text message or email. Click Confirm Subscription.

    The subscription is successful if you receive a feedback indicating successful subscription.

    After the recipient confirms the subscription, you need to restart the skill, so that the recipient will receive an email or SMS notification when the skill has any output.

    In the subscription list, the recipient icon changes from gray to orange .