日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS ReminderHelper

ReminderHelper

java.lang.Object

|---ohos.event.notification.ReminderHelper

public class ReminderHelper
extends Object

提供管理提醒的靜態(tài)方法,包括發(fā)布或取消提醒、添加或刪除通知槽、獲取或取消當前應用的所有提醒。

Since:

6

方法總結(jié)

修飾符和類型方法描述
static voidaddNotificationSlot(NotificationSlot slot)創(chuàng)建一個 NotificationSlot。
static voidcancelAllReminders()取消當前第三方申請的所有提醒
static voidcancelReminder(int reminderId)取消指定的提醒。
static ListReminderRequestgetValidReminders()獲取當前應用設(shè)置的所有有效提醒通知,即以后仍會觸發(fā)的提醒。
static intpublishReminder(ReminderRequest reminderReq)發(fā)布計劃提醒。
static voidremoveNotificationSlot(String slotId)刪除提醒使用的 NotificationSlot 實例。
從類 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

方法詳情

publishReminder

public static int publishReminder(ReminderRequest reminderReq) throws ReminderManager.AppLimitExceedsException, ReminderManager.SysLimitExceedsException, RemoteException

發(fā)布計劃提醒。

第三方應用可以調(diào)用該方法發(fā)布定時提醒。調(diào)用此方法后,調(diào)用應用程序的定時和彈出通知功能將由系統(tǒng)服務(wù)代理在后臺執(zhí)行,即使應用程序被凍結(jié)或退出。您可以調(diào)用 ReminderRequest#setIntentAgent(String, String) 方法來指定是否在錄制彈出通知后啟動應用程序。

后臺代理維護所有第三方應用程序的有序提醒列表。該列表根據(jù)每個提醒的預定觸發(fā)時間進行更新。系統(tǒng)一次僅啟動一個最近的預定提醒。如果添加了觸發(fā)時間較近的提醒,則新的預定提醒將放在列表頂部。只有在當前提醒完成后才會觸發(fā)下一個提醒。

一個應用最多可以創(chuàng)建30個有效提醒,系統(tǒng)有效提醒總數(shù)不能超過2000個。提醒的最小貪睡間隔為5分鐘。

權(quán)限:ohos.permission.PUBLISH_AGENT_REMINDER

參數(shù):

參數(shù)名稱參數(shù)描述
reminderReq指示要發(fā)布的提醒實例。 此參數(shù)不能為空。 否則會因為參數(shù)無效而拋出異常,導致應用程序崩潰。

返回:

返回唯一的提醒 ID。

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。
ReminderManager.AppLimitExceedsException如果系統(tǒng)中當前應用的有效提醒次數(shù)超過30次(不包括已過期不再觸發(fā)的提醒),則拋出該異常。
ReminderManager.SysLimitExceedsException系統(tǒng)有效提醒總數(shù)超過2000條(不包括已過期不再觸發(fā)的提醒),則拋出該異常。

Since:

6

addNotificationSlot

public static void addNotificationSlot(NotificationSlot slot) throws RemoteException

創(chuàng)建一個 NotificationSlot。 您可以調(diào)用 ReminderRequest#setSlotId(String) 方法來綁定用于發(fā)布提醒的槽。

當應用程序被卸載時,所有與應用程序相關(guān)的通知槽都將被刪除。

參數(shù):

參數(shù)名稱參數(shù)描述
slot指示要添加的 NotificationSlot 實例。

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。

Since:

6

cancelReminder

public static void cancelReminder(int reminderId) throws RemoteException

取消指定的提醒。

參數(shù):

參數(shù)名稱參數(shù)描述
reminderId指示要取消的提醒實例的 ID。

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。

Since:

6

removeNotificationSlot

public static void removeNotificationSlot(String slotId) throws RemoteException

刪除提醒使用的 NotificationSlot 實例。

參數(shù):

參數(shù)名稱參數(shù)描述
slotId指示要刪除的 NotificationSlot 實例的 ID。

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。

Since:

6

getValidReminders

public static ListReminderRequest getValidReminders() throws RemoteException

獲取當前應用設(shè)置的所有有效提醒通知,即以后仍會觸發(fā)的提醒。 如果不再觸發(fā)提醒,則不視為有效提醒。

返回:

返回一個數(shù)組列表,其中包含當前應用程序設(shè)置的所有有效提醒通知。

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。

Since:

6

cancelAllReminders

public static void cancelAllReminders() throws RemoteException

取消當前第三方申請的所有提醒

Throws:

Throw名稱Throw描述
RemoteException在進程間通信錯誤時引發(fā)此異常。

Since:

6


網(wǎng)頁名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS ReminderHelper
瀏覽地址:http://www.5511xx.com/article/djgsicc.html