1# @system.notification (通知消息)
2
3> **说明:**
4> - 从API Version 7 开始,该接口不再维护,推荐使用新接口[`@ohos.notification`](js-apis-notification.md)。
5>
6> - 本模块首批接口从API version 3开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
7
8
9## 导入模块
10
11
12```ts
13import notification from '@system.notification';
14```
15
16## ActionResult
17
18**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
19
20| 名称        | 类型                                           | 必填 | 说明                      |
21| ----------- | ---------------------------------------------- | ---- | ------------------------- |
22| bundleName  | string                                          | 是   | 单击通知后要重定向到的应用程序的Bundle名。                  |
23| abilityName  | string                                          | 是   | 单击通知后要重定向到的应用程序的Ability名称。 |
24| uri         | string                                          | 否   | 要重定向到的页面的uri。              |
25
26
27## ShowNotificationOptions
28
29**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
30
31| 名称          | 类型                                           | 必填 | 说明                        |
32| ------------- | ---------------------------------------------- | ---- | ------------------------- |
33| contentTitle  | string                                          | 否   | 通知标题。                  |
34| contentText   | string                                          | 否   | 通知内容。                  |
35| clickAction   | ActionResult                                    | 否   | 通知被点击后触发的行为。     |
36
37
38## notification.show
39
40show(options?: ShowNotificationOptions): void
41
42显示通知。
43
44**系统能力:** SystemCapability.Notification.Notification
45
46**参数:**
47
48| 参数名 | 类型 | 必填 | 说明 |
49| -------- | -------- | -------- | -------- |
50| options | ShowNotificationOptions | 否 | 通知标题。 |
51
52**示例:**
53```ts
54let notificationObj: notification = {
55  show() {
56    notification.show({
57      contentTitle: 'title info',
58      contentText: 'text',
59      clickAction: {
60        bundleName: 'com.example.testapp',
61        abilityName: 'notificationDemo',
62        uri: '/path/to/notification'
63      }
64    });
65  }
66}
67```