harmony(鸿蒙)JS API Changes of the Common Event and Notification Framework

  • 2022-08-09
  • 浏览 (582)

JS API Changes of the Common Event and Notification Framework

The table below lists the APIs changes of the common event and notification framework in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.

API Changes

Module Class Method/Attribute/Enumeration/Constant Change Type
notificationUserInput NotificationUserInput inputKey: string; Added
notificationTemplate NotificationTemplate data: {[key: string]: Object}; Added
notificationTemplate NotificationTemplate name: string; Added
notificationRequest DistributedOptions supportOperateDevices?: Array<string>; Added
notificationRequest DistributedOptions supportDisplayDevices?: Array<string>; Added
notificationRequest DistributedOptions isDistributed?: boolean; Added
notificationRequest NotificationRequest readonly notificationFlags?: NotificationFlags; Added
notificationRequest NotificationRequest distributedOption?: DistributedOptions; Added
notificationRequest NotificationRequest template?: NotificationTemplate; Added
notificationRequest NotificationRequest readonly creatorUserId?: number; Added
notificationRequest NotificationRequest groupName?: string; Added
notificationActionButton NotificationActionButton userInput?: NotificationUserInput; Added
ohos.notification notification isDistributedEnabled(callback: AsyncCallback<boolean>): void;
isDistributedEnabled(): Promise<boolean>;
Added
ohos.notification notification requestEnableNotification(callback: AsyncCallback<void>): void;
requestEnableNotification(): Promise<void>;
Added
ohos.notification notification isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void;
isSupportTemplate(templateName: string): Promise<boolean>;
Added
ohos.notification notification cancelGroup(groupName: string, callback: AsyncCallback<void>): void;
cancelGroup(groupName: string): Promise<void>;
Added
ohos.events.emitter EventPriority IDLE Added
ohos.events.emitter EventPriority LOW Added
ohos.events.emitter EventPriority HIGH Added
ohos.events.emitter EventPriority IMMEDIATE = 0 Added
ohos.events.emitter InnerEvent priority?: EventPriority; Added
ohos.events.emitter InnerEvent eventId: number; Added
ohos.events.emitter EventData data?: {[key: string]: any}; Added
ohos.events.emitter emitter emit(event: InnerEvent, data?: EventData): void; Added
ohos.events.emitter emitter off(eventId: number): void; Added
ohos.events.emitter emitter once(event: InnerEvent, callback: Callback<EventData>): void; Added
ohos.events.emitter emitter on(event: InnerEvent, callback: Callback<EventData>): void; Added
ohos.commonEvent Support COMMON_EVENT_SPLIT_SCREEN = “common.event.SPLIT_SCREEN” Added
ohos.commonEvent Support COMMON_EVENT_THERMAL_LEVEL_CHANGED = “usual.event.THERMAL_LEVEL_CHANGED” Added

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)

harmony(鸿蒙)JS API Changes of the Ability Framework

harmony(鸿蒙)JS API Changes of the Accessibility Subsystem

harmony(鸿蒙)JS API Changes of the Account Subsystem

harmony(鸿蒙)JS API Changes of the ArkUI Development Framework

harmony(鸿蒙)JS API Changes of the Power Management Subsystem

harmony(鸿蒙)JS API Changes of the Bundle Management Framework

harmony(鸿蒙)JS API Changes of the Communication Subsystem

harmony(鸿蒙)JS API Changes of the Utils Subsystem

0  赞