harmony 鸿蒙NotificationRequest

2023-06-24 浏览 (767)

NotificationRequest

描述通知的请求。

说明:

本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

NotificationRequest

系统能力:以下各项对应的系统能力均为SystemCapability.Notification.Notification

名称类型必填说明
contentNotificationContent通知内容。
idnumber通知ID。
slotTypeSlotType通道类型。
isOngoingboolean是否进行时通知。
isUnremovableboolean是否可移除(应用于长时间通知任务上,比如地图、音乐播放;点击通知下方删除按钮无法删除,左滑点击单个删除按钮可删除)。
deliveryTimenumber通知发送时间。
tapDismissedboolean通知是否自动清除。
autoDeletedTimenumber自动清除的时间。
wantAgentWantAgentWantAgent封装了应用的行为意图,点击通知时触发该行为。
extraInfo{[key: string]: any}扩展参数。
colornumber通知背景颜色。预留能力,暂未支持。
colorEnabledboolean通知背景颜色是否使能。预留能力,暂未支持。
isAlertOnceboolean设置是否仅有一次此通知提醒。
isStopwatchboolean是否显示已用时间。
isCountDownboolean是否显示倒计时时间。
isFloatingIconboolean是否显示状态栏图标。
labelstring通知标签。
badgeIconStylenumber通知角标类型。预留能力,暂未支持。
showDeliveryTimeboolean是否显示分发时间。
actionButtonsArray<NotificationActionButton>通知按钮,最多三个按钮。
smallIconimage.PixelMap通知小图标。可选字段,大小不超过30KB。
largeIconimage.PixelMap通知大图标。可选字段,大小不超过30KB。
creatorBundleNamestring创建通知的包名。
creatorUidnumber创建通知的UID。
creatorPidnumber创建通知的PID。
creatorUserId8+number创建通知的UserId。
hashCodestring通知唯一标识。
classificationstring通知分类。
系统API: 此接口为系统接口,三方应用不支持调用。
groupName8+string组通知名称。
template8+NotificationTemplate通知模板。
isRemoveAllowed8+boolean通知是否能被移除(点击通知下方删除按钮无法删除,左滑不出现删除按钮)。
系统API: 此接口为系统接口,三方应用不支持调用。
source8+number通知源。
系统API: 此接口为系统接口,三方应用不支持调用。
distributedOption8+DistributedOptions分布式通知的选项。
deviceId8+string通知源的deviceId。
系统API: 此接口为系统接口,三方应用不支持调用。
notificationFlags8+NotificationFlags获取NotificationFlags。
removalWantAgent9+WantAgent当移除通知时,通知将被重定向到的WantAgent实例。
badgeNumber9+number应用程序图标上显示的通知数。

DistributedOptions

描述分布式选项。

系统能力:以下各项对应的系统能力均为SystemCapability.Notification.Notification

名称类型必填说明
isDistributed8+boolean是否为分布式通知。
supportDisplayDevices8+Array<string>可以同步通知到的设备列表。
supportOperateDevices8+Array<string>可以打开通知的设备列表。
remindType8+number通知的提醒方式。
系统API: 此接口为系统接口,三方应用不支持调用。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙接口

harmony 鸿蒙系统公共事件定义(待停用)

harmony 鸿蒙系统公共事件定义

harmony 鸿蒙开发说明

harmony 鸿蒙企业设备管理概述(仅对系统应用开放)

harmony 鸿蒙BundleStatusCallback

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

harmony 鸿蒙@ohos.distributedBundle (分布式包管理)

harmony 鸿蒙@ohos.bundle (Bundle模块)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (企业设备管理扩展能力)

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