codecamp

通知的请求

描述通知的请求。

说明

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

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

名称

类型

可读

可写

说明

content

NotificationContent

是

是

通知内容。

id

number

是

是

通知ID。

slotType

SlotType

是

是

通道类型。

isOngoing

boolean

是

是

是否进行时通知。

isUnremovable

boolean

是

是

是否可移除。

deliveryTime

number

是

是

通知发送时间。

tapDismissed

boolean

是

是

通知是否自动清除。

autoDeletedTime

number

是

是

自动清除的时间。

wantAgent

WantAgent

是

是

WantAgent封装了应用的行为意图,点击通知时触发该行为。

extraInfo

{[key: string]: any}

是

是

扩展参数。

color

number

是

是

通知背景颜色。预留能力,暂未支持。

colorEnabled

boolean

是

是

通知背景颜色是否使能。预留能力,暂未支持。

isAlertOnce

boolean

是

是

设置是否仅有一次此通知提醒。

isStopwatch

boolean

是

是

是否显示已用时间。

isCountDown

boolean

是

是

是否显示倒计时时间。

isFloatingIcon

boolean

是

是

是否显示状态栏图标。

label

string

是

是

通知标签。

badgeIconStyle

number

是

是

通知角标类型。

showDeliveryTime

boolean

是

是

是否显示分发时间。

actionButtons

Array<NotificationActionButton>

是

是

通知按钮,最多三个按钮。

smallIcon

image.PixelMap

是

是

通知小图标。可选字段,大小不超过30KB。

largeIcon

image.PixelMap

是

是

通知大图标。可选字段,大小不超过30KB。

creatorBundleName

string

是

否

创建通知的包名。

creatorUid8+

number

是

否

创建通知的UID。

creatorPid

number

是

否

创建通知的PID。

creatorUserId

number

是

否

创建通知的UserId。

hashCode

string

是

否

通知唯一标识。

groupName8+

string

是

是

组通知名称。

template8+

NotificationTemplate

是

是

通知模板。

distributedOption8+

DistributedOptions

是

是

分布式通知的选项。

notificationFlags8+

NotificationFlags

是

否

获取NotificationFlags。

removalWantAgent9+

WantAgent

是

是

当移除通知时,通知将被重定向到的WantAgent实例。

badgeNumber9+

number

是

是

应用程序图标上显示的通知数。

DistributedOptions

描述分布式选项。

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

名称

类型

可读

可写

说明

isDistributed8+

boolean

是

是

是否为分布式通知。

supportDisplayDevices8+

Array<string>

是

是

可以同步通知到的设备列表。

supportOperateDevices8+

Array<string>

是

是

可以打开通知的设备列表。

通知标志的实例
通知槽
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

媒体组件

像素

枚举

类型

接口

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }