通知的請求

2024-01-23 13:03 更新

描述通知的請求。

說明

本模塊首批接口從API version 7開始支持。后續(xù)版本的新增接口,采用上角標(biāo)單獨標(biāo)記接口的起始版本。

系統(tǒng)能力:以下各項對應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.Notification

名稱

類型

可讀

可寫

說明

content

NotificationContent

通知內(nèi)容。

id

number

通知ID。

slotType

SlotType

通道類型。

isOngoing

boolean

是否進(jìn)行時通知。

isUnremovable

boolean

是否可移除。

deliveryTime

number

通知發(fā)送時間。

tapDismissed

boolean

通知是否自動清除。

autoDeletedTime

number

自動清除的時間。

wantAgent

WantAgent

WantAgent封裝了應(yīng)用的行為意圖,點擊通知時觸發(fā)該行為。

extraInfo

{[key: string]: any}

擴(kuò)展參數(shù)。

color

number

通知背景顏色。預(yù)留能力,暫未支持。

colorEnabled

boolean

通知背景顏色是否使能。預(yù)留能力,暫未支持。

isAlertOnce

boolean

設(shè)置是否僅有一次此通知提醒。

isStopwatch

boolean

是否顯示已用時間。

isCountDown

boolean

是否顯示倒計時時間。

isFloatingIcon

boolean

是否顯示狀態(tài)欄圖標(biāo)。

label

string

通知標(biāo)簽。

badgeIconStyle

number

通知角標(biāo)類型。

showDeliveryTime

boolean

是否顯示分發(fā)時間。

actionButtons

Array<NotificationActionButton>

通知按鈕,最多三個按鈕。

smallIcon

image.PixelMap

通知小圖標(biāo)??蛇x字段,大小不超過30KB。

largeIcon

image.PixelMap

通知大圖標(biāo)。可選字段,大小不超過30KB。

creatorBundleName

string

創(chuàng)建通知的包名。

creatorUid8+

number

創(chuàng)建通知的UID。

creatorPid

number

創(chuàng)建通知的PID。

creatorUserId

number

創(chuàng)建通知的UserId。

hashCode

string

通知唯一標(biāo)識。

groupName8+

string

組通知名稱。

template8+

NotificationTemplate

通知模板。

distributedOption8+

DistributedOptions

分布式通知的選項。

notificationFlags8+

NotificationFlags

獲取NotificationFlags。

removalWantAgent9+

WantAgent

當(dāng)移除通知時,通知將被重定向到的WantAgent實例。

badgeNumber9+

number

應(yīng)用程序圖標(biāo)上顯示的通知數(shù)。

DistributedOptions

描述分布式選項。

系統(tǒng)能力:以下各項對應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.Notification

名稱

類型

可讀

可寫

說明

isDistributed8+

boolean

是否為分布式通知。

supportDisplayDevices8+

Array<string>

可以同步通知到的設(shè)備列表。

supportOperateDevices8+

Array<string>

可以打開通知的設(shè)備列表。

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號