harmony 鸿蒙NotificationContent

  • 2023-06-24
  • 浏览 (497)

NotificationContent

The NotificationContent module provides APIs for defining the notification content.

NOTE

The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.

NotificationContent

System capability: SystemCapability.Notification.Notification

Name Type Read-only Mandatory Description
contentType ContentType No Yes Notification content type.
normal NotificationBasicContent No No Normal text.
longText NotificationLongTextContent No No Long text.
multiLine NotificationMultiLineContent No No Multi-line text.
picture NotificationPictureContent No No Picture-attached.

NotificationBasicContent

Describes the normal text notification.

System capability: SystemCapability.Notification.Notification

Name Type Mandatory Description
title string Yes Notification title.
text string Yes Notification content.
additionalText string No Additional information of the notification.

NotificationLongTextContent

Describes the long text notification.

System capability: SystemCapability.Notification.Notification

Name Type Mandatory Description
title string Yes Notification title.
text string Yes Notification content.
additionalText string No Additional information of the notification.
longText string Yes Long text of the notification.
briefText string Yes Brief text of the notification.
expandedTitle string Yes Title of the notification in the expanded state.

NotificationMultiLineContent

Describes the multi-line text notification.

System capability: SystemCapability.Notification.Notification

Name Type Readable Writable Description
title string No Yes Notification title.
text string No Yes Notification content.
additionalText string No No Additional information of the notification.
briefText string No Yes Brief text of the notification.
longTitle string No Yes Title of the notification in the expanded state.
lines Array<string> No Yes Multi-line text of the notification.

NotificationPictureContent

Describes the picture-attached notification.

System capability: SystemCapability.Notification.Notification

Name Type Readable Writable Description
title string No Yes Notification title.
text string No Yes Notification content.
additionalText string No No Additional information of the notification.
briefText string No Yes Brief text of the notification.
expandedTitle string No Yes Title of the notification in the expanded state.
picture image.PixelMap No Yes Picture attached to the notification. The maximum size is 2 MB.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

0  赞