harmony 鸿蒙NotificationRequest

2023-06-24 浏览 (802)

NotificationRequest

The NotificationRequest module provides APIs for defining the notification request.

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.

NotificationRequest

System capability: SystemCapability.Notification.Notification

NameTypeMandatoryDescription
contentNotificationContentYesNotification content.
idnumberNoNotification ID.
slotTypeSlotTypeNoNotification slot type.
isOngoingbooleanNoWhether the notification is an ongoing notification.
isUnremovablebooleanNoWhether the notification can be removed. This parameter applies to continuous notification tasks, such as navigation and music playback. If a notifiation is not removable, it will not be deleted when the user touches the delete button below the notification, but it can still be deleted by swiping left on the notification and touching the delete button.
deliveryTimenumberNoTime when the notification is sent.
tapDismissedbooleanNoWhether the notification is automatically cleared.
autoDeletedTimenumberNoTime when the notification is automatically cleared.
wantAgentWantAgentNoWantAgent instance to which the notification will be redirected after being clicked.
extraInfo{[key: string]: any}NoExtended parameters.
colornumberNoBackground color of the notification. Not supported currently.
colorEnabledbooleanNoWhether the notification background color can be enabled. Not supported currently.
isAlertOncebooleanNoWhether the notification triggers an alert only once.
isStopwatchbooleanNoWhether to display the stopwatch.
isCountDownbooleanNoWhether to display the countdown time.
isFloatingIconbooleanNoWhether the notification is displayed as a floating icon in the status bar.
labelstringNoNotification label.
badgeIconStylenumberNoNotification badge type. Not supported currently.
showDeliveryTimebooleanNoWhether to display the time when the notification is delivered.
actionButtonsArray<NotificationActionButton>NoButtons in the notification. Up to three buttons are allowed.
smallIconimage.PixelMapNoSmall notification icon. This field is optional, and the icon size cannot exceed 30 KB.
largeIconimage.PixelMapNoLarge notification icon. This field is optional, and the icon size cannot exceed 30 KB.
creatorBundleNamestringNoName of the bundle that creates the notification.
creatorUidnumberNoUID used for creating the notification.
creatorPidnumberNoPID used for creating the notification.
creatorUserId8+numberNoID of the user who creates the notification.
hashCodestringNoUnique ID of the notification.
classificationstringNoNotification category.
System API: This is a system API and cannot be called by third-party applications.
groupName8+stringNoNotification group name.
template8+NotificationTemplateNoNotification template.
isRemoveAllowed8+booleanNoWhether the notification can be removed. If a notifiation is not removable, it will not be deleted when the user touches the delete button below the notification, but it can still be deleted by swiping left on the notification and touching the delete button.
System API: This is a system API and cannot be called by third-party applications.
source8+numberNoNotification source.
System API: This is a system API and cannot be called by third-party applications.
distributedOption8+DistributedOptionsNoDistributed notification options.
deviceId8+stringNoDevice ID of the notification source.
System API: This is a system API and cannot be called by third-party applications.
notificationFlags8+NotificationFlagsNoNotification flags.
removalWantAgent9+WantAgentNoWantAgent instance to which the notification will be redirected when it is removed.
badgeNumber9+numberNoNumber of notifications displayed on the application icon.

DistributedOptions

Describes distributed notification options.

System capability: SystemCapability.Notification.Notification

NameTypeMandatoryDescription
isDistributed8+booleanNoWhether the notification is a distributed notification.
supportDisplayDevices8+Array<string>NoList of the devices to which the notification can be synchronized.
supportOperateDevices8+Array<string>NoList of the devices on which the notification can be opened.
remindType8+numberNoNotification reminder type.
System API: This is a system API and cannot be called by third-party applications.

你可能感兴趣的鸿蒙文章

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)

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/14b87fb43db2426cb9c4c7b15897a2e9