Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7633bbe0
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7633bbe0
编写于
2月 04, 2023
作者:
zyjhandsome
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
js-apis-notifications模块异常场景只有err.code
Signed-off-by:
zyjhandsome
<
zyjhandsome@126.com
>
上级
2cdf4cad
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
2 addition
and
142 deletion
+2
-142
zh-cn/application-dev/reference/apis/js-apis-notification.md
zh-cn/application-dev/reference/apis/js-apis-notification.md
+2
-142
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-notification.md
浏览文件 @
7633bbe0
...
@@ -35,7 +35,7 @@ publish(request: NotificationRequest, callback: AsyncCallback\<void\>): void
...
@@ -35,7 +35,7 @@ publish(request: NotificationRequest, callback: AsyncCallback\<void\>): void
// publish回调
// publish回调
function
publishCallback
(
err
)
{
function
publishCallback
(
err
)
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
`publish failed, code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
console
.
error
(
`publish failed, code is
${
err
.
code
}
`
);
}
else
{
}
else
{
console
.
info
(
"
publish success
"
);
console
.
info
(
"
publish success
"
);
}
}
...
@@ -55,8 +55,6 @@ let notificationRequest = {
...
@@ -55,8 +55,6 @@ let notificationRequest = {
Notification
.
publish
(
notificationRequest
,
publishCallback
);
Notification
.
publish
(
notificationRequest
,
publishCallback
);
```
```
## Notification.publish
## Notification.publish
publish(request: NotificationRequest): Promise
\<
void
\>
publish(request: NotificationRequest): Promise
\<
void
\>
...
@@ -118,7 +116,7 @@ publish(request: NotificationRequest, userId: number, callback: AsyncCallback\<v
...
@@ -118,7 +116,7 @@ publish(request: NotificationRequest, userId: number, callback: AsyncCallback\<v
// publish回调
// publish回调
function
publishCallback
(
err
)
{
function
publishCallback
(
err
)
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
`publish failed, code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
console
.
error
(
`publish failed, code is
${
err
.
code
}
`
);
}
else
{
}
else
{
console
.
info
(
"
publish success
"
);
console
.
info
(
"
publish success
"
);
}
}
...
@@ -298,8 +296,6 @@ function cancelAllCallback(err) {
...
@@ -298,8 +296,6 @@ function cancelAllCallback(err) {
Notification
.
cancelAll
(
cancelAllCallback
);
Notification
.
cancelAll
(
cancelAllCallback
);
```
```
## Notification.cancelAll
## Notification.cancelAll
cancelAll(): Promise
\<
void
\>
cancelAll(): Promise
\<
void
\>
...
@@ -316,8 +312,6 @@ Notification.cancelAll().then(() => {
...
@@ -316,8 +312,6 @@ Notification.cancelAll().then(() => {
});
});
```
```
## Notification.addSlot
## Notification.addSlot
addSlot(slot: NotificationSlot, callback: AsyncCallback
\<
void
\>
): void
addSlot(slot: NotificationSlot, callback: AsyncCallback
\<
void
\>
): void
...
@@ -355,8 +349,6 @@ let notificationSlot = {
...
@@ -355,8 +349,6 @@ let notificationSlot = {
Notification
.
addSlot
(
notificationSlot
,
addSlotCallBack
);
Notification
.
addSlot
(
notificationSlot
,
addSlotCallBack
);
```
```
## Notification.addSlot
## Notification.addSlot
addSlot(slot: NotificationSlot): Promise
\<
void
\>
addSlot(slot: NotificationSlot): Promise
\<
void
\>
...
@@ -387,8 +379,6 @@ Notification.addSlot(notificationSlot).then(() => {
...
@@ -387,8 +379,6 @@ Notification.addSlot(notificationSlot).then(() => {
});
});
```
```
## Notification.addSlot
## Notification.addSlot
addSlot(type: SlotType, callback: AsyncCallback
\<
void
\>
): void
addSlot(type: SlotType, callback: AsyncCallback
\<
void
\>
): void
...
@@ -418,8 +408,6 @@ function addSlotCallBack(err) {
...
@@ -418,8 +408,6 @@ function addSlotCallBack(err) {
Notification
.
addSlot
(
Notification
.
SlotType
.
SOCIAL_COMMUNICATION
,
addSlotCallBack
);
Notification
.
addSlot
(
Notification
.
SlotType
.
SOCIAL_COMMUNICATION
,
addSlotCallBack
);
```
```
## Notification.addSlot
## Notification.addSlot
addSlot(type: SlotType): Promise
\<
void
\>
addSlot(type: SlotType): Promise
\<
void
\>
...
@@ -442,8 +430,6 @@ Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION).then(() => {
...
@@ -442,8 +430,6 @@ Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION).then(() => {
});
});
```
```
## Notification.addSlots
## Notification.addSlots
addSlots(slots: Array
\<
NotificationSlot
\>
, callback: AsyncCallback
\<
void
\>
): void
addSlots(slots: Array
\<
NotificationSlot
\>
, callback: AsyncCallback
\<
void
\>
): void
...
@@ -485,8 +471,6 @@ notificationSlotArray[0] = notificationSlot;
...
@@ -485,8 +471,6 @@ notificationSlotArray[0] = notificationSlot;
Notification
.
addSlots
(
notificationSlotArray
,
addSlotsCallBack
);
Notification
.
addSlots
(
notificationSlotArray
,
addSlotsCallBack
);
```
```
## Notification.addSlots
## Notification.addSlots
addSlots(slots: Array
\<
NotificationSlot
\>
): Promise
\<
void
\>
addSlots(slots: Array
\<
NotificationSlot
\>
): Promise
\<
void
\>
...
@@ -521,8 +505,6 @@ Notification.addSlots(notificationSlotArray).then(() => {
...
@@ -521,8 +505,6 @@ Notification.addSlots(notificationSlotArray).then(() => {
});
});
```
```
## Notification.getSlot
## Notification.getSlot
getSlot(slotType: SlotType, callback: AsyncCallback
\<
NotificationSlot
\>
): void
getSlot(slotType: SlotType, callback: AsyncCallback
\<
NotificationSlot
\>
): void
...
@@ -553,8 +535,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
...
@@ -553,8 +535,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification
.
getSlot
(
slotType
,
getSlotCallback
);
Notification
.
getSlot
(
slotType
,
getSlotCallback
);
```
```
## Notification.getSlot
## Notification.getSlot
getSlot(slotType: SlotType): Promise
\<
NotificationSlot
\>
getSlot(slotType: SlotType): Promise
\<
NotificationSlot
\>
...
@@ -584,8 +564,6 @@ Notification.getSlot(slotType).then((data) => {
...
@@ -584,8 +564,6 @@ Notification.getSlot(slotType).then((data) => {
});
});
```
```
## Notification.getSlots
## Notification.getSlots
getSlots(callback: AsyncCallback
<Array
\<
NotificationSlot
\
>
>): void
getSlots(callback: AsyncCallback
<Array
\<
NotificationSlot
\
>
>): void
...
@@ -614,8 +592,6 @@ function getSlotsCallback(err, data) {
...
@@ -614,8 +592,6 @@ function getSlotsCallback(err, data) {
Notification
.
getSlots
(
getSlotsCallback
);
Notification
.
getSlots
(
getSlotsCallback
);
```
```
## Notification.getSlots
## Notification.getSlots
getSlots(): Promise
\<
Array
\<
NotificationSlot
\>
>
getSlots(): Promise
\<
Array
\<
NotificationSlot
\>
>
...
@@ -638,8 +614,6 @@ Notification.getSlots().then((data) => {
...
@@ -638,8 +614,6 @@ Notification.getSlots().then((data) => {
});
});
```
```
## Notification.removeSlot
## Notification.removeSlot
removeSlot(slotType: SlotType, callback: AsyncCallback
\<
void
\>
): void
removeSlot(slotType: SlotType, callback: AsyncCallback
\<
void
\>
): void
...
@@ -670,8 +644,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
...
@@ -670,8 +644,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification
.
removeSlot
(
slotType
,
removeSlotCallback
);
Notification
.
removeSlot
(
slotType
,
removeSlotCallback
);
```
```
## Notification.removeSlot
## Notification.removeSlot
removeSlot(slotType: SlotType): Promise
\<
void
\>
removeSlot(slotType: SlotType): Promise
\<
void
\>
...
@@ -695,8 +667,6 @@ Notification.removeSlot(slotType).then(() => {
...
@@ -695,8 +667,6 @@ Notification.removeSlot(slotType).then(() => {
});
});
```
```
## Notification.removeAllSlots
## Notification.removeAllSlots
removeAllSlots(callback: AsyncCallback
\<
void
\>
): void
removeAllSlots(callback: AsyncCallback
\<
void
\>
): void
...
@@ -724,8 +694,6 @@ function removeAllCallBack(err) {
...
@@ -724,8 +694,6 @@ function removeAllCallBack(err) {
Notification
.
removeAllSlots
(
removeAllCallBack
);
Notification
.
removeAllSlots
(
removeAllCallBack
);
```
```
## Notification.removeAllSlots
## Notification.removeAllSlots
removeAllSlots(): Promise
\<
void
\>
removeAllSlots(): Promise
\<
void
\>
...
@@ -742,8 +710,6 @@ Notification.removeAllSlots().then(() => {
...
@@ -742,8 +710,6 @@ Notification.removeAllSlots().then(() => {
});
});
```
```
## Notification.subscribe
## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback
\<
void
\>
): void
subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback
\<
void
\>
): void
...
@@ -787,8 +753,6 @@ let info = {
...
@@ -787,8 +753,6 @@ let info = {
Notification
.
subscribe
(
subscriber
,
info
,
subscribeCallback
);
Notification
.
subscribe
(
subscriber
,
info
,
subscribeCallback
);
```
```
## Notification.subscribe
## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback
\<
void
\>
): void
subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback
\<
void
\>
): void
...
@@ -827,8 +791,6 @@ let subscriber = {
...
@@ -827,8 +791,6 @@ let subscriber = {
Notification
.
subscribe
(
subscriber
,
subscribeCallback
);
Notification
.
subscribe
(
subscriber
,
subscribeCallback
);
```
```
## Notification.subscribe
## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise
\<
void
\>
subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise
\<
void
\>
...
@@ -862,8 +824,6 @@ Notification.subscribe(subscriber).then(() => {
...
@@ -862,8 +824,6 @@ Notification.subscribe(subscriber).then(() => {
});
});
```
```
## Notification.unsubscribe
## Notification.unsubscribe
unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback
\<
void
\>
): void
unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback
\<
void
\>
): void
...
@@ -902,8 +862,6 @@ let subscriber = {
...
@@ -902,8 +862,6 @@ let subscriber = {
Notification
.
unsubscribe
(
subscriber
,
unsubscribeCallback
);
Notification
.
unsubscribe
(
subscriber
,
unsubscribeCallback
);
```
```
## Notification.unsubscribe
## Notification.unsubscribe
unsubscribe(subscriber: NotificationSubscriber): Promise
\<
void
\>
unsubscribe(subscriber: NotificationSubscriber): Promise
\<
void
\>
...
@@ -936,8 +894,6 @@ Notification.unsubscribe(subscriber).then(() => {
...
@@ -936,8 +894,6 @@ Notification.unsubscribe(subscriber).then(() => {
});
});
```
```
## Notification.enableNotification
## Notification.enableNotification
enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback
\<
void
\>
): void
enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback
\<
void
\>
): void
...
@@ -974,8 +930,6 @@ let bundle = {
...
@@ -974,8 +930,6 @@ let bundle = {
Notification
.
enableNotification
(
bundle
,
false
,
enableNotificationCallback
);
Notification
.
enableNotification
(
bundle
,
false
,
enableNotificationCallback
);
```
```
## Notification.enableNotification
## Notification.enableNotification
enableNotification(bundle: BundleOption, enable: boolean): Promise
\<
void
\>
enableNotification(bundle: BundleOption, enable: boolean): Promise
\<
void
\>
...
@@ -1006,8 +960,6 @@ Notification.enableNotification(bundle, false).then(() => {
...
@@ -1006,8 +960,6 @@ Notification.enableNotification(bundle, false).then(() => {
});
});
```
```
## Notification.isNotificationEnabled
## Notification.isNotificationEnabled
isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback
\<
boolean
\>
): void
isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback
\<
boolean
\>
): void
...
@@ -1043,8 +995,6 @@ let bundle = {
...
@@ -1043,8 +995,6 @@ let bundle = {
Notification
.
isNotificationEnabled
(
bundle
,
isNotificationEnabledCallback
);
Notification
.
isNotificationEnabled
(
bundle
,
isNotificationEnabledCallback
);
```
```
## Notification.isNotificationEnabled
## Notification.isNotificationEnabled
isNotificationEnabled(bundle: BundleOption): Promise
\<
boolean
\>
isNotificationEnabled(bundle: BundleOption): Promise
\<
boolean
\>
...
@@ -1080,8 +1030,6 @@ Notification.isNotificationEnabled(bundle).then((data) => {
...
@@ -1080,8 +1030,6 @@ Notification.isNotificationEnabled(bundle).then((data) => {
});
});
```
```
## Notification.isNotificationEnabled
## Notification.isNotificationEnabled
isNotificationEnabled(callback: AsyncCallback
\<
boolean
\>
): void
isNotificationEnabled(callback: AsyncCallback
\<
boolean
\>
): void
...
@@ -1114,8 +1062,6 @@ function isNotificationEnabledCallback(err, data) {
...
@@ -1114,8 +1062,6 @@ function isNotificationEnabledCallback(err, data) {
Notification
.
isNotificationEnabled
(
isNotificationEnabledCallback
);
Notification
.
isNotificationEnabled
(
isNotificationEnabledCallback
);
```
```
## Notification.isNotificationEnabled
## Notification.isNotificationEnabled
isNotificationEnabled(): Promise
\<
boolean
\>
isNotificationEnabled(): Promise
\<
boolean
\>
...
@@ -1148,8 +1094,6 @@ Notification.isNotificationEnabled().then((data) => {
...
@@ -1148,8 +1094,6 @@ Notification.isNotificationEnabled().then((data) => {
});
});
```
```
## Notification.displayBadge
## Notification.displayBadge
displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback
\<
void
\>
): void
displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback
\<
void
\>
): void
...
@@ -1186,8 +1130,6 @@ let bundle = {
...
@@ -1186,8 +1130,6 @@ let bundle = {
Notification
.
displayBadge
(
bundle
,
false
,
displayBadgeCallback
);
Notification
.
displayBadge
(
bundle
,
false
,
displayBadgeCallback
);
```
```
## Notification.displayBadge
## Notification.displayBadge
displayBadge(bundle: BundleOption, enable: boolean): Promise
\<
void
\>
displayBadge(bundle: BundleOption, enable: boolean): Promise
\<
void
\>
...
@@ -1218,8 +1160,6 @@ Notification.displayBadge(bundle, false).then(() => {
...
@@ -1218,8 +1160,6 @@ Notification.displayBadge(bundle, false).then(() => {
});
});
```
```
## Notification.isBadgeDisplayed
## Notification.isBadgeDisplayed
isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback
\<
boolean
\>
): void
isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback
\<
boolean
\>
): void
...
@@ -1255,8 +1195,6 @@ let bundle = {
...
@@ -1255,8 +1195,6 @@ let bundle = {
Notification
.
isBadgeDisplayed
(
bundle
,
isBadgeDisplayedCallback
);
Notification
.
isBadgeDisplayed
(
bundle
,
isBadgeDisplayedCallback
);
```
```
## Notification.isBadgeDisplayed
## Notification.isBadgeDisplayed
isBadgeDisplayed(bundle: BundleOption): Promise
\<
boolean
\>
isBadgeDisplayed(bundle: BundleOption): Promise
\<
boolean
\>
...
@@ -1292,8 +1230,6 @@ Notification.isBadgeDisplayed(bundle).then((data) => {
...
@@ -1292,8 +1230,6 @@ Notification.isBadgeDisplayed(bundle).then((data) => {
});
});
```
```
## Notification.setSlotByBundle
## Notification.setSlotByBundle
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback
\<
void
\>
): void
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback
\<
void
\>
): void
...
@@ -1333,8 +1269,6 @@ let notificationSlot = {
...
@@ -1333,8 +1269,6 @@ let notificationSlot = {
Notification
.
setSlotByBundle
(
bundle
,
notificationSlot
,
setSlotByBundleCallback
);
Notification
.
setSlotByBundle
(
bundle
,
notificationSlot
,
setSlotByBundleCallback
);
```
```
## Notification.setSlotByBundle
## Notification.setSlotByBundle
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise
\<
void
\>
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise
\<
void
\>
...
@@ -1368,8 +1302,6 @@ Notification.setSlotByBundle(bundle, notificationSlot).then(() => {
...
@@ -1368,8 +1302,6 @@ Notification.setSlotByBundle(bundle, notificationSlot).then(() => {
});
});
```
```
## Notification.getSlotsByBundle
## Notification.getSlotsByBundle
getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback
<Array
\<
NotificationSlot
\
>
>): void
getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback
<Array
\<
NotificationSlot
\
>
>): void
...
@@ -1405,8 +1337,6 @@ let bundle = {
...
@@ -1405,8 +1337,6 @@ let bundle = {
Notification
.
getSlotsByBundle
(
bundle
,
getSlotsByBundleCallback
);
Notification
.
getSlotsByBundle
(
bundle
,
getSlotsByBundleCallback
);
```
```
## Notification.getSlotsByBundle
## Notification.getSlotsByBundle
getSlotsByBundle(bundle: BundleOption): Promise
<Array
\<
NotificationSlot
\
>
>
getSlotsByBundle(bundle: BundleOption): Promise
<Array
\<
NotificationSlot
\
>
>
...
@@ -1442,8 +1372,6 @@ Notification.getSlotsByBundle(bundle).then((data) => {
...
@@ -1442,8 +1372,6 @@ Notification.getSlotsByBundle(bundle).then((data) => {
});
});
```
```
## Notification.getSlotNumByBundle
## Notification.getSlotNumByBundle
getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback
\<
number
\>
): void
getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback
\<
number
\>
): void
...
@@ -1479,8 +1407,6 @@ let bundle = {
...
@@ -1479,8 +1407,6 @@ let bundle = {
Notification
.
getSlotNumByBundle
(
bundle
,
getSlotNumByBundleCallback
);
Notification
.
getSlotNumByBundle
(
bundle
,
getSlotNumByBundleCallback
);
```
```
## Notification.getSlotNumByBundle
## Notification.getSlotNumByBundle
getSlotNumByBundle(bundle: BundleOption): Promise
\<
number
\>
getSlotNumByBundle(bundle: BundleOption): Promise
\<
number
\>
...
@@ -1516,8 +1442,6 @@ Notification.getSlotNumByBundle(bundle).then((data) => {
...
@@ -1516,8 +1442,6 @@ Notification.getSlotNumByBundle(bundle).then((data) => {
});
});
```
```
## Notification.remove
## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback
\<
void
\>
): void
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback
\<
void
\>
): void
...
@@ -1560,8 +1484,6 @@ let reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
...
@@ -1560,8 +1484,6 @@ let reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
Notification
.
remove
(
bundle
,
notificationKey
,
reason
,
removeCallback
);
Notification
.
remove
(
bundle
,
notificationKey
,
reason
,
removeCallback
);
```
```
## Notification.remove
## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise
\<
void
\>
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise
\<
void
\>
...
@@ -1598,8 +1520,6 @@ Notification.remove(bundle, notificationKey, reason).then(() => {
...
@@ -1598,8 +1520,6 @@ Notification.remove(bundle, notificationKey, reason).then(() => {
});
});
```
```
## Notification.remove
## Notification.remove
remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback
\<
void
\>
): void
remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback
\<
void
\>
): void
...
@@ -1636,8 +1556,6 @@ let reason = Notification.RemoveReason.CANCEL_REASON_REMOVE;
...
@@ -1636,8 +1556,6 @@ let reason = Notification.RemoveReason.CANCEL_REASON_REMOVE;
Notification
.
remove
(
hashCode
,
reason
,
removeCallback
);
Notification
.
remove
(
hashCode
,
reason
,
removeCallback
);
```
```
## Notification.remove
## Notification.remove
remove(hashCode: string, reason: RemoveReason): Promise
\<
void
\>
remove(hashCode: string, reason: RemoveReason): Promise
\<
void
\>
...
@@ -1667,8 +1585,6 @@ Notification.remove(hashCode, reason).then(() => {
...
@@ -1667,8 +1585,6 @@ Notification.remove(hashCode, reason).then(() => {
});
});
```
```
## Notification.removeAll
## Notification.removeAll
removeAll(bundle: BundleOption, callback: AsyncCallback
\<
void
\>
): void
removeAll(bundle: BundleOption, callback: AsyncCallback
\<
void
\>
): void
...
@@ -1704,8 +1620,6 @@ let bundle = {
...
@@ -1704,8 +1620,6 @@ let bundle = {
Notification
.
removeAll
(
bundle
,
removeAllCallback
);
Notification
.
removeAll
(
bundle
,
removeAllCallback
);
```
```
## Notification.removeAll
## Notification.removeAll
removeAll(callback: AsyncCallback
\<
void
\>
): void
removeAll(callback: AsyncCallback
\<
void
\>
): void
...
@@ -1738,8 +1652,6 @@ function removeAllCallback(err) {
...
@@ -1738,8 +1652,6 @@ function removeAllCallback(err) {
Notification
.
removeAll
(
removeAllCallback
);
Notification
.
removeAll
(
removeAllCallback
);
```
```
## Notification.removeAll
## Notification.removeAll
removeAll(bundle?: BundleOption): Promise
\<
void
\>
removeAll(bundle?: BundleOption): Promise
\<
void
\>
...
@@ -1861,8 +1773,6 @@ function getAllActiveNotificationsCallback(err, data) {
...
@@ -1861,8 +1773,6 @@ function getAllActiveNotificationsCallback(err, data) {
Notification
.
getAllActiveNotifications
(
getAllActiveNotificationsCallback
);
Notification
.
getAllActiveNotifications
(
getAllActiveNotificationsCallback
);
```
```
## Notification.getAllActiveNotifications
## Notification.getAllActiveNotifications
getAllActiveNotifications(): Promise
\<
Array
\<
[
NotificationRequest
](
#notificationrequest
)
\>\>
getAllActiveNotifications(): Promise
\<
Array
\<
[
NotificationRequest
](
#notificationrequest
)
\>\>
...
@@ -1889,8 +1799,6 @@ Notification.getAllActiveNotifications().then((data) => {
...
@@ -1889,8 +1799,6 @@ Notification.getAllActiveNotifications().then((data) => {
});
});
```
```
## Notification.getActiveNotificationCount
## Notification.getActiveNotificationCount
getActiveNotificationCount(callback: AsyncCallback
\<
number
\>
): void
getActiveNotificationCount(callback: AsyncCallback
\<
number
\>
): void
...
@@ -1919,8 +1827,6 @@ function getActiveNotificationCountCallback(err, data) {
...
@@ -1919,8 +1827,6 @@ function getActiveNotificationCountCallback(err, data) {
Notification
.
getActiveNotificationCount
(
getActiveNotificationCountCallback
);
Notification
.
getActiveNotificationCount
(
getActiveNotificationCountCallback
);
```
```
## Notification.getActiveNotificationCount
## Notification.getActiveNotificationCount
getActiveNotificationCount(): Promise
\<
number
\>
getActiveNotificationCount(): Promise
\<
number
\>
...
@@ -1943,8 +1849,6 @@ Notification.getActiveNotificationCount().then((data) => {
...
@@ -1943,8 +1849,6 @@ Notification.getActiveNotificationCount().then((data) => {
});
});
```
```
## Notification.getActiveNotifications
## Notification.getActiveNotifications
getActiveNotifications(callback: AsyncCallback
<Array
\<
NotificationRequest
\
>
>): void
getActiveNotifications(callback: AsyncCallback
<Array
\<
NotificationRequest
\
>
>): void
...
@@ -1973,8 +1877,6 @@ function getActiveNotificationsCallback(err, data) {
...
@@ -1973,8 +1877,6 @@ function getActiveNotificationsCallback(err, data) {
Notification
.
getActiveNotifications
(
getActiveNotificationsCallback
);
Notification
.
getActiveNotifications
(
getActiveNotificationsCallback
);
```
```
## Notification.getActiveNotifications
## Notification.getActiveNotifications
getActiveNotifications(): Promise
\<
Array
\<
[
NotificationRequest
](
#notificationrequest
)
\>\>
getActiveNotifications(): Promise
\<
Array
\<
[
NotificationRequest
](
#notificationrequest
)
\>\>
...
@@ -1997,8 +1899,6 @@ Notification.getActiveNotifications().then((data) => {
...
@@ -1997,8 +1899,6 @@ Notification.getActiveNotifications().then((data) => {
});
});
```
```
## Notification.cancelGroup<sup>8+</sup>
## Notification.cancelGroup<sup>8+</sup>
cancelGroup(groupName: string, callback: AsyncCallback
\<
void
\>
): void
cancelGroup(groupName: string, callback: AsyncCallback
\<
void
\>
): void
...
@@ -2030,8 +1930,6 @@ let groupName = "GroupName";
...
@@ -2030,8 +1930,6 @@ let groupName = "GroupName";
Notification
.
cancelGroup
(
groupName
,
cancelGroupCallback
);
Notification
.
cancelGroup
(
groupName
,
cancelGroupCallback
);
```
```
## Notification.cancelGroup<sup>8+</sup>
## Notification.cancelGroup<sup>8+</sup>
cancelGroup(groupName: string): Promise
\<
void
\>
cancelGroup(groupName: string): Promise
\<
void
\>
...
@@ -2055,8 +1953,6 @@ Notification.cancelGroup(groupName).then(() => {
...
@@ -2055,8 +1953,6 @@ Notification.cancelGroup(groupName).then(() => {
});
});
```
```
## Notification.removeGroupByBundle<sup>8+</sup>
## Notification.removeGroupByBundle<sup>8+</sup>
removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback
\<
void
\>
): void
removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback
\<
void
\>
): void
...
@@ -2094,8 +1990,6 @@ let groupName = "GroupName";
...
@@ -2094,8 +1990,6 @@ let groupName = "GroupName";
Notification
.
removeGroupByBundle
(
bundleOption
,
groupName
,
removeGroupByBundleCallback
);
Notification
.
removeGroupByBundle
(
bundleOption
,
groupName
,
removeGroupByBundleCallback
);
```
```
## Notification.removeGroupByBundle<sup>8+</sup>
## Notification.removeGroupByBundle<sup>8+</sup>
removeGroupByBundle(bundle: BundleOption, groupName: string): Promise
\<
void
\>
removeGroupByBundle(bundle: BundleOption, groupName: string): Promise
\<
void
\>
...
@@ -2125,8 +2019,6 @@ Notification.removeGroupByBundle(bundleOption, groupName).then(() => {
...
@@ -2125,8 +2019,6 @@ Notification.removeGroupByBundle(bundleOption, groupName).then(() => {
});
});
```
```
## Notification.setDoNotDisturbDate<sup>8+</sup>
## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback
\<
void
\>
): void
setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback
\<
void
\>
): void
...
@@ -2166,8 +2058,6 @@ let doNotDisturbDate = {
...
@@ -2166,8 +2058,6 @@ let doNotDisturbDate = {
Notification
.
setDoNotDisturbDate
(
doNotDisturbDate
,
setDoNotDisturbDateCallback
);
Notification
.
setDoNotDisturbDate
(
doNotDisturbDate
,
setDoNotDisturbDateCallback
);
```
```
## Notification.setDoNotDisturbDate<sup>8+</sup>
## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate): Promise
\<
void
\>
setDoNotDisturbDate(date: DoNotDisturbDate): Promise
\<
void
\>
...
@@ -2241,8 +2131,6 @@ let userId = 1
...
@@ -2241,8 +2131,6 @@ let userId = 1
Notification
.
setDoNotDisturbDate
(
doNotDisturbDate
,
userId
,
setDoNotDisturbDateCallback
);
Notification
.
setDoNotDisturbDate
(
doNotDisturbDate
,
userId
,
setDoNotDisturbDateCallback
);
```
```
## Notification.setDoNotDisturbDate<sup>8+</sup>
## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise
\<
void
\>
setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise
\<
void
\>
...
@@ -2311,8 +2199,6 @@ function getDoNotDisturbDateCallback(err, data) {
...
@@ -2311,8 +2199,6 @@ function getDoNotDisturbDateCallback(err, data) {
Notification
.
getDoNotDisturbDate
(
getDoNotDisturbDateCallback
);
Notification
.
getDoNotDisturbDate
(
getDoNotDisturbDateCallback
);
```
```
## Notification.getDoNotDisturbDate<sup>8+</sup>
## Notification.getDoNotDisturbDate<sup>8+</sup>
getDoNotDisturbDate(): Promise
\<
DoNotDisturbDate
\>
getDoNotDisturbDate(): Promise
\<
DoNotDisturbDate
\>
...
@@ -2375,8 +2261,6 @@ let userId = 1;
...
@@ -2375,8 +2261,6 @@ let userId = 1;
Notification
.
getDoNotDisturbDate
(
userId
,
getDoNotDisturbDateCallback
);
Notification
.
getDoNotDisturbDate
(
userId
,
getDoNotDisturbDateCallback
);
```
```
## Notification.getDoNotDisturbDate<sup>8+</sup>
## Notification.getDoNotDisturbDate<sup>8+</sup>
getDoNotDisturbDate(userId: number): Promise
\<
DoNotDisturbDate
\>
getDoNotDisturbDate(userId: number): Promise
\<
DoNotDisturbDate
\>
...
@@ -2444,8 +2328,6 @@ function supportDoNotDisturbModeCallback(err,data) {
...
@@ -2444,8 +2328,6 @@ function supportDoNotDisturbModeCallback(err,data) {
Notification
.
supportDoNotDisturbMode
(
supportDoNotDisturbModeCallback
);
Notification
.
supportDoNotDisturbMode
(
supportDoNotDisturbModeCallback
);
```
```
## Notification.supportDoNotDisturbMode<sup>8+</sup>
## Notification.supportDoNotDisturbMode<sup>8+</sup>
supportDoNotDisturbMode(): Promise
\<
boolean
\>
supportDoNotDisturbMode(): Promise
\<
boolean
\>
...
@@ -2472,8 +2354,6 @@ Notification.supportDoNotDisturbMode().then((data) => {
...
@@ -2472,8 +2354,6 @@ Notification.supportDoNotDisturbMode().then((data) => {
});
});
```
```
## Notification.isSupportTemplate<sup>8+</sup>
## Notification.isSupportTemplate<sup>8+</sup>
isSupportTemplate(templateName: string, callback: AsyncCallback
\<
boolean
\>
): void
isSupportTemplate(templateName: string, callback: AsyncCallback
\<
boolean
\>
): void
...
@@ -2504,8 +2384,6 @@ function isSupportTemplateCallback(err, data) {
...
@@ -2504,8 +2384,6 @@ function isSupportTemplateCallback(err, data) {
Notification
.
isSupportTemplate
(
templateName
,
isSupportTemplateCallback
);
Notification
.
isSupportTemplate
(
templateName
,
isSupportTemplateCallback
);
```
```
## Notification.isSupportTemplate<sup>8+</sup>
## Notification.isSupportTemplate<sup>8+</sup>
isSupportTemplate(templateName: string): Promise
\<
boolean
\>
isSupportTemplate(templateName: string): Promise
\<
boolean
\>
...
@@ -2536,8 +2414,6 @@ Notification.isSupportTemplate(templateName).then((data) => {
...
@@ -2536,8 +2414,6 @@ Notification.isSupportTemplate(templateName).then((data) => {
});
});
```
```
## Notification.requestEnableNotification<sup>8+</sup>
## Notification.requestEnableNotification<sup>8+</sup>
requestEnableNotification(callback: AsyncCallback
\<
void
\>
): void
requestEnableNotification(callback: AsyncCallback
\<
void
\>
): void
...
@@ -2566,8 +2442,6 @@ function requestEnableNotificationCallback(err) {
...
@@ -2566,8 +2442,6 @@ function requestEnableNotificationCallback(err) {
Notification
.
requestEnableNotification
(
requestEnableNotificationCallback
);
Notification
.
requestEnableNotification
(
requestEnableNotificationCallback
);
```
```
## Notification.requestEnableNotification<sup>8+</sup>
## Notification.requestEnableNotification<sup>8+</sup>
requestEnableNotification(): Promise
\<
void
\>
requestEnableNotification(): Promise
\<
void
\>
...
@@ -2620,8 +2494,6 @@ let enable = true;
...
@@ -2620,8 +2494,6 @@ let enable = true;
Notification
.
enableDistributed
(
enable
,
enabledNotificationCallback
);
Notification
.
enableDistributed
(
enable
,
enabledNotificationCallback
);
```
```
## Notification.enableDistributed<sup>8+</sup>
## Notification.enableDistributed<sup>8+</sup>
enableDistributed(enable: boolean): Promise
\<
void>
enableDistributed(enable: boolean): Promise
\<
void>
...
@@ -2678,8 +2550,6 @@ function isDistributedEnabledCallback(err, data) {
...
@@ -2678,8 +2550,6 @@ function isDistributedEnabledCallback(err, data) {
Notification
.
isDistributedEnabled
(
isDistributedEnabledCallback
);
Notification
.
isDistributedEnabled
(
isDistributedEnabledCallback
);
```
```
## Notification.isDistributedEnabled<sup>8+</sup>
## Notification.isDistributedEnabled<sup>8+</sup>
isDistributedEnabled(): Promise
\<
boolean>
isDistributedEnabled(): Promise
\<
boolean>
...
@@ -2743,8 +2613,6 @@ let enable = true;
...
@@ -2743,8 +2613,6 @@ let enable = true;
Notification
.
enableDistributedByBundle
(
bundle
,
enable
,
enableDistributedByBundleCallback
);
Notification
.
enableDistributedByBundle
(
bundle
,
enable
,
enableDistributedByBundleCallback
);
```
```
## Notification.enableDistributedByBundle<sup>8+</sup>
## Notification.enableDistributedByBundle<sup>8+</sup>
enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise
\<
void>
enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise
\<
void>
...
@@ -2814,8 +2682,6 @@ let bundle = {
...
@@ -2814,8 +2682,6 @@ let bundle = {
Notification
.
isDistributedEnabledByBundle
(
bundle
,
isDistributedEnabledByBundleCallback
);
Notification
.
isDistributedEnabledByBundle
(
bundle
,
isDistributedEnabledByBundleCallback
);
```
```
## Notification.isDistributedEnabledByBundle<sup>8+</sup>
## Notification.isDistributedEnabledByBundle<sup>8+</sup>
isDistributedEnabledByBundle(bundle: BundleOption): Promise
\<
boolean>
isDistributedEnabledByBundle(bundle: BundleOption): Promise
\<
boolean>
...
@@ -2885,8 +2751,6 @@ function getDeviceRemindTypeCallback(err,data) {
...
@@ -2885,8 +2751,6 @@ function getDeviceRemindTypeCallback(err,data) {
Notification
.
getDeviceRemindType
(
getDeviceRemindTypeCallback
);
Notification
.
getDeviceRemindType
(
getDeviceRemindTypeCallback
);
```
```
## Notification.getDeviceRemindType<sup>8+</sup>
## Notification.getDeviceRemindType<sup>8+</sup>
getDeviceRemindType(): Promise
\<
DeviceRemindType
\>
getDeviceRemindType(): Promise
\<
DeviceRemindType
\>
...
@@ -3381,8 +3245,6 @@ Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => {
...
@@ -3381,8 +3245,6 @@ Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => {
});
});
```
```
## NotificationSubscriber
## NotificationSubscriber
作为订阅通知接口
[
subscribe
](
#notificationsubscribe
)
的入参,提供订阅者接收到新通知、取消通知等的回调方法。
作为订阅通知接口
[
subscribe
](
#notificationsubscribe
)
的入参,提供订阅者接收到新通知、取消通知等的回调方法。
...
@@ -3797,8 +3659,6 @@ Notification.enableNotification(bundle, false).then(() => {
...
@@ -3797,8 +3659,6 @@ Notification.enableNotification(bundle, false).then(() => {
| bundle | string | 是 | 是 | 应用的包信息。 |
| bundle | string | 是 | 是 | 应用的包信息。 |
| uid | number | 是 | 是 | 用户ID。 |
| uid | number | 是 | 是 | 用户ID。 |
## NotificationKey
## NotificationKey
**系统能力**
:以下各项对应的系统能力均为SystemCapability.Notification.Notification
**系统能力**
:以下各项对应的系统能力均为SystemCapability.Notification.Notification
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录