W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
本模塊提供后臺(tái)代理提醒的能力。
開發(fā)應(yīng)用時(shí),開發(fā)者可以調(diào)用后臺(tái)提醒發(fā)布的接口創(chuàng)建定時(shí)提醒,包括倒計(jì)時(shí)、日歷、鬧鐘三種提醒類型。使用后臺(tái)代理提醒能力后,應(yīng)用可以被凍結(jié)或退出,計(jì)時(shí)和彈出提醒的功能將被后臺(tái)系統(tǒng)服務(wù)代理。
本模塊首批接口從API version 9開始支持。后續(xù)版本的新增接口,采用上角標(biāo)單獨(dú)標(biāo)記接口的起始版本。
publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void
發(fā)布一個(gè)后臺(tái)代理提醒,使用callback方式實(shí)現(xiàn)異步調(diào)用,該方法需要申請(qǐng)通知彈窗Notification.requestEnableNotification后才能調(diào)用。
需要權(quán)限: ohos.permission.PUBLISH_AGENT_REMINDER
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
reminderReq | 是 | 需要發(fā)布的提醒實(shí)例。 | |
callback | AsyncCallback<number> | 是 | 異步回調(diào),返回當(dāng)前發(fā)布的提醒的reminderId。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700001 | Notification is not enabled. |
1700002 | The number of reminders exceeds the limit. |
示例:
- let timer = {
- reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER,
- triggerTimeInSeconds: 10
- }
- try {
- reminderAgentManager.publishReminder(timer, (err, reminderId) => {
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("callback, reminderId = " + reminderId);
- }
- });
- } catch (error) {
- console.log("publishReminder code:" + error.code + " message:" + error.message);
- };
publishReminder(reminderReq: ReminderRequest): Promise<number>
發(fā)布一個(gè)后臺(tái)代理提醒,使用Promise方式實(shí)現(xiàn)異步調(diào)用,該方法需要申請(qǐng)通知彈窗Notification.requestEnableNotification后才能調(diào)用。
需要權(quán)限: ohos.permission.PUBLISH_AGENT_REMINDER
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
reminderReq | 是 | 需要發(fā)布的提醒實(shí)例。 |
返回值:
類型 | 說明 |
---|---|
Promise<number> | 返回提醒的reminderId。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700001 | Notification is not enabled. |
1700002 | The number of reminders exceeds the limit. |
示例:
- let timer = {
- reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER,
- triggerTimeInSeconds: 10
- }
- try {
- reminderAgentManager.publishReminder(timer).then((reminderId) => {
- console.log("promise, reminderId = " + reminderId);
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("publishReminder code:" + error.code + " message:" + error.message);
- };
cancelReminder(reminderId: number, callback: AsyncCallback<void>): void
取消指定id的提醒,使用callback方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
reminderId | number | 是 | 目標(biāo)reminder的id號(hào)。 |
callback | AsyncCallback<void> | 是 | 異步回調(diào)。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700003 | The reminder does not exist. |
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.cancelReminder(1, (err, data) => {
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("cancelReminder callback");
- }
- });
- } catch (error) {
- console.log("cancelReminder code:" + error.code + " message:" + error.message);
- };
cancelReminder(reminderId: number): Promise<void>
取消指定id的提醒,使用Promise方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
reminderId | number | 是 | 目標(biāo)reminder的id號(hào)。 |
返回值:
類型 | 說明 |
---|---|
Promise<void> | Promise類型異步回調(diào)。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700003 | The reminder does not exist. |
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.cancelReminder(1).then(() => {
- console.log("cancelReminder promise");
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("cancelReminder code:" + error.code + " message:" + error.message);
- };
getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void
獲取當(dāng)前應(yīng)用已設(shè)置的所有有效(未過期)的提醒,使用callback方式實(shí)現(xiàn)異步調(diào)用。
當(dāng)?shù)竭_(dá)設(shè)置的提醒時(shí)間點(diǎn)時(shí),通知中心會(huì)彈出相應(yīng)提醒的通知卡片(通知欄消息)。若未點(diǎn)擊通知卡片上的關(guān)閉/CLOSE按鈕,則代理提醒是有效/未過期的;若點(diǎn)擊了關(guān)閉/CLOSE按鈕,則代理提醒過期。
當(dāng)代理提醒類型是鬧鐘時(shí),若設(shè)置每天提醒,無論是否點(diǎn)擊關(guān)閉/CLOSE按鈕,代理提醒都是有效的。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
callback | AsyncCallback<Array<ReminderRequest>> | 是 | 異步回調(diào),返回當(dāng)前應(yīng)用已設(shè)置的所有有效(未過期)的提醒。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.getValidReminders((err, reminders) => {
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("callback, getValidReminders length = " + reminders.length);
- for (let i = 0; i < reminders.length; i++) {
- console.log("getValidReminders = " + reminders[i]);
- console.log("getValidReminders, reminderType = " + reminders[i].reminderType);
- for (let j = 0; j < reminders[i].actionButton.length; j++) {
- console.log("getValidReminders, actionButton.title = " + reminders[i].actionButton[j].title);
- console.log("getValidReminders, actionButton.type = " + reminders[i].actionButton[j].type);
- }
- console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent.pkgName);
- console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent.abilityName);
- console.log("getValidReminders, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent.pkgName);
- console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent.abilityName);
- console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
- console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
- console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
- console.log("getValidReminders, title = " + reminders[i].title);
- console.log("getValidReminders, content = " + reminders[i].content);
- console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
- console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
- console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
- console.log("getValidReminders, slotType = " + reminders[i].slotType);
- }
- }
- })
- } catch (error) {
- console.log("getValidReminders code:" + error.code + " message:" + error.message);
- };
getValidReminders(): Promise<Array<ReminderRequest>>
獲取當(dāng)前應(yīng)用已設(shè)置的所有有效(未過期)的提醒,使用Promise方式實(shí)現(xiàn)異步調(diào)用。
當(dāng)?shù)竭_(dá)設(shè)置的提醒時(shí)間點(diǎn)時(shí),通知中心會(huì)彈出相應(yīng)提醒的通知卡片(通知欄消息)。若未點(diǎn)擊通知卡片上的關(guān)閉/CLOSE按鈕,則代理提醒是有效/未過期的;若點(diǎn)擊了關(guān)閉/CLOSE按鈕,則代理提醒過期。
當(dāng)代理提醒類型是鬧鐘時(shí),若設(shè)置每天提醒,無論是否點(diǎn)擊關(guān)閉/CLOSE按鈕,代理提醒都是有效的。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
返回值:
類型 | 說明 |
---|---|
Promise<Array<ReminderRequest>> | 返回當(dāng)前應(yīng)用已設(shè)置的所有有效(未過期)的提醒。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.getValidReminders().then((reminders) => {
- console.log("promise, getValidReminders length = " + reminders.length);
- for (let i = 0; i < reminders.length; i++) {
- console.log("getValidReminders = " + reminders[i]);
- console.log("getValidReminders, reminderType = " + reminders[i].reminderType);
- for (let j = 0; j < reminders[i].actionButton.length; j++) {
- console.log("getValidReminders, actionButton.title = " + reminders[i].actionButton[j].title);
- console.log("getValidReminders, actionButton.type = " + reminders[i].actionButton[j].type);
- }
- console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent.pkgName);
- console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent.abilityName);
- console.log("getValidReminders, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent.pkgName);
- console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent.abilityName);
- console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
- console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
- console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
- console.log("getValidReminders, title = " + reminders[i].title);
- console.log("getValidReminders, content = " + reminders[i].content);
- console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
- console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
- console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
- console.log("getValidReminders, slotType = " + reminders[i].slotType);
- }
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("getValidReminders code:" + error.code + " message:" + error.message);
- };
cancelAllReminders(callback: AsyncCallback<void>): void
取消當(dāng)前應(yīng)用所有的提醒,使用callback方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
callback | AsyncCallback<void> | 是 | 異步回調(diào)。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.cancelAllReminders((err, data) =>{
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("cancelAllReminders callback")
- }
- })
- } catch (error) {
- console.log("cancelAllReminders code:" + error.code + " message:" + error.message);
- };
cancelAllReminders(): Promise<void>
取消當(dāng)前應(yīng)用所有的提醒,使用Promise方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
返回值:
類型 | 說明 |
---|---|
Promise<void> | Promise類型異步回調(diào)。 |
錯(cuò)誤碼:
以下錯(cuò)誤碼的詳細(xì)介紹請(qǐng)參見@ohos.reminderAgentManager(后臺(tái)代理提醒)錯(cuò)誤碼。
錯(cuò)誤碼ID | 錯(cuò)誤信息 |
---|---|
1700004 | The bundle name does not exist. |
示例:
- try {
- reminderAgentManager.cancelAllReminders().then(() => {
- console.log("cancelAllReminders promise")
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("cancelAllReminders code:" + error.code + " message:" + error.message);
- };
addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void
添加一個(gè)NotificationSlot,使用callback方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
slot | 是 | notification slot實(shí)例,僅支持設(shè)置其type屬性。 | |
callback | AsyncCallback<void> | 是 | 異步回調(diào)。 |
示例:
- import notification from '@ohos.notification'
- let mySlot = {
- type: notification.SlotType.SOCIAL_COMMUNICATION
- }
- try {
- reminderAgentManager.addNotificationSlot(mySlot, (err, data) => {
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("addNotificationSlot callback");
- }
- });
- } catch (error) {
- console.log("addNotificationSlot code:" + error.code + " message:" + error.message);
- };
addNotificationSlot(slot: NotificationSlot): Promise<void>
添加一個(gè)NotificationSlot,使用Promise方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
slot | 是 | notification slot實(shí)例,僅支持設(shè)置其type屬性。 |
返回值:
類型 | 說明 |
---|---|
Promise<void> | Promise類型異步回調(diào)。 |
示例:
- import notification from '@ohos.notification'
- let mySlot = {
- type: notification.SlotType.SOCIAL_COMMUNICATION
- }
- try {
- reminderAgentManager.addNotificationSlot(mySlot).then(() => {
- console.log("addNotificationSlot promise");
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("addNotificationSlot code:" + error.code + " message:" + error.message);
- };
removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void
刪除目標(biāo)NotificationSlot,使用callback方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
slotType | 是 | 目標(biāo)notification slot的類型。 | |
callback | AsyncCallback<void> | 是 | 異步回調(diào)。 |
示例:
- import notification from '@ohos.notification'
- try {
- reminderAgentManager.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => {
- if (err) {
- console.log("callback err code:" + err.code + " message:" + err.message);
- } else {
- console.log("removeNotificationSlot callback");
- }
- });
- } catch (error) {
- console.log("removeNotificationSlot code:" + error.code + " message:" + error.message);
- };
removeNotificationSlot(slotType: notification.SlotType): Promise<void>
刪除目標(biāo)NotificationSlot,使用Promise方式實(shí)現(xiàn)異步調(diào)用。
系統(tǒng)能力: SystemCapability.Notification.ReminderAgent
參數(shù):
參數(shù)名 | 類型 | 必填 | 說明 |
---|---|---|---|
slotType | 是 | 目標(biāo)notification slot的類型。 |
返回值:
類型 | 說明 |
---|---|
Promise<void> | Promise類型異步回調(diào)。 |
示例:
- import notification from '@ohos.notification'
- try {
- reminderAgentManager.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
- console.log("removeNotificationSlot promise");
- }).catch(err => {
- console.log("promise err code:" + err.code + " message:" + err.message);
- });
- } catch (error) {
- console.log("removeNotificationSlot code:" + error.code + " message:" + error.message);
- };
按鈕的類型。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 值 | 說明 |
---|---|---|
ACTION_BUTTON_TYPE_CLOSE | 0 | 表示關(guān)閉提醒的按鈕。 |
ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延遲提醒的按鈕。 |
提醒的類型。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 值 | 說明 |
---|---|---|
REMINDER_TYPE_TIMER | 0 | 表示提醒類型:倒計(jì)時(shí)。 |
REMINDER_TYPE_CALENDAR | 1 | 表示提醒類型:日歷。 |
REMINDER_TYPE_ALARM | 2 | 表示提醒類型:鬧鐘。 |
用于設(shè)置彈出的提醒通知信息上顯示的按鈕類型和標(biāo)題。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
title | string | 是 | 按鈕顯示的標(biāo)題。 |
type | 是 | 按鈕的類型。 |
點(diǎn)擊提醒通知后跳轉(zhuǎn)的目標(biāo)ability信息。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
pkgName | string | 是 | 指明點(diǎn)擊提醒通知欄后跳轉(zhuǎn)的目標(biāo)hap包名。 |
abilityName | string | 是 | 指明點(diǎn)擊提醒通知欄后跳轉(zhuǎn)的目標(biāo)ability名稱。 |
全屏顯示提醒到達(dá)時(shí)自動(dòng)拉起的目標(biāo)ability信息,該接口預(yù)留。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
pkgName | string | 是 | 指明提醒到達(dá)時(shí)自動(dòng)拉起的目標(biāo)hap包名(如果設(shè)備在使用中,則只彈出通知橫幅框)。 |
abilityName | string | 是 | 指明提醒到達(dá)時(shí)自動(dòng)拉起的目標(biāo)ability名(如果設(shè)備在使用中,則只彈出通知橫幅框)。 |
提醒實(shí)例對(duì)象,用于設(shè)置提醒類型、響鈴時(shí)長(zhǎng)等具體信息。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
reminderType | 是 | 指明提醒類型。 | |
actionButton | 否 | 彈出的提醒通知欄中顯示的按鈕(參數(shù)可選,支持0/1/2個(gè)按鈕)。 | |
wantAgent | 否 | 點(diǎn)擊通知后需要跳轉(zhuǎn)的目標(biāo)ability信息。 | |
maxScreenWantAgent | 否 | 提醒到達(dá)時(shí)跳轉(zhuǎn)的目標(biāo)包。如果設(shè)備正在使用中,則彈出一個(gè)通知框。 | |
ringDuration | number | 否 | 指明響鈴時(shí)長(zhǎng)(單位:秒),默認(rèn)1秒。 |
snoozeTimes | number | 否 | 指明延遲提醒次數(shù),默認(rèn)0次(不適用于倒計(jì)時(shí)提醒類型)。 |
timeInterval | number | 否 | 執(zhí)行延遲提醒間隔(單位:秒),默認(rèn)0秒(不適用于倒計(jì)時(shí)提醒類型)。 |
title | string | 否 | 指明提醒標(biāo)題。 |
content | string | 否 | 指明提醒內(nèi)容。 |
expiredContent | string | 否 | 指明提醒過期后需要顯示的內(nèi)容。 |
snoozeContent | string | 否 | 指明延遲提醒時(shí)需要顯示的內(nèi)容。 |
notificationId | number | 否 | 指明提醒使用的通知的id號(hào),相同id號(hào)的提醒會(huì)覆蓋。 |
slotType | 否 | 指明提醒的slot類型。 |
ReminderRequestCalendar extends ReminderRequest
日歷實(shí)例對(duì)象,用于設(shè)置提醒的時(shí)間。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
dateTime | 是 | 指明提醒的目標(biāo)時(shí)間。 | |
repeatMonths | Array<number> | 否 | 指明重復(fù)提醒的月份。 |
repeatDays | Array<number> | 否 | 指明重復(fù)提醒的日期。 |
ReminderRequestAlarm extends ReminderRequest
鬧鐘實(shí)例對(duì)象,用于設(shè)置提醒的時(shí)間。
系統(tǒng)能力:以下各項(xiàng)對(duì)應(yīng)的系統(tǒng)能力均為SystemCapability.Notification.ReminderAgent
名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
hour | number | 是 | 指明提醒的目標(biāo)時(shí)刻。 |
minute | number | 是 | 指明提醒的目標(biāo)分鐘。 |
daysOfWeek | Array<number> | 否 | 指明每周哪幾天需要重復(fù)提醒。范圍為周一到周末,對(duì)應(yīng)數(shù)字為1到7。 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: