Chat SDK for Android v1.3.2
agora java chat SDK
 
Loading...
Searching...
No Matches
io.agora.chat.PushManager Class Reference

Classes

enum  DisplayStyle
 
enum  EMPushAction
 
enum  PushRemindType
 

Public Member Functions

PushConfigs getPushConfigs ()
 
PushConfigs getPushConfigsFromServer () throws ChatException
 
boolean updatePushNickname (String nickname) throws IllegalArgumentException, ChatException
 
void asyncUpdatePushNickname (String nickname, CallBack callback)
 
void updatePushDisplayStyle (DisplayStyle style) throws IllegalArgumentException, ChatException
 
void asyncUpdatePushDisplayStyle (DisplayStyle style, CallBack callback)
 
void setSilentModeForConversation (String conversationId, Conversation.ConversationType type, SilentModeParam param, ValueCallBack< SilentModeResult > callBack)
 
void clearRemindTypeForConversation (String conversationId, Conversation.ConversationType type, CallBack callBack)
 
void getSilentModeForConversation (String conversationId, Conversation.ConversationType type, ValueCallBack< SilentModeResult > callBack)
 
void setSilentModeForAll (SilentModeParam param, ValueCallBack< SilentModeResult > callBack)
 
void getSilentModeForAll (ValueCallBack< SilentModeResult > callBack)
 
void getSilentModeForConversations (List< Conversation > conversationList, ValueCallBack< Map< String, SilentModeResult > > callBack)
 
void syncSilentModeConversationsFromServer (CallBack callBack)
 
void setPreferredNotificationLanguage (String languageCode, CallBack callBack)
 
void getPreferredNotificationLanguage (ValueCallBack< String > callBack)
 
void bindDeviceToken (String notifierName, String deviceToken, CallBack callBack)
 
void setPushTemplate (String templateName, CallBack callBack)
 
void getPushTemplate (ValueCallBack< String > callBack)
 
void reportPushAction (JSONObject json, EMPushAction action, CallBack callBack)
 

Detailed Description

The offline push manager.

Member Function Documentation

◆ asyncUpdatePushDisplayStyle()

void io.agora.chat.PushManager.asyncUpdatePushDisplayStyle ( DisplayStyle style,
CallBack callback )

Updates the display style of push notifications. The default value is DisplayStyle#SimpleBanner.

This is an asynchronous method.

Reference: For the asynchronous method, see updatePushDisplayStyle(DisplayStyle).

Parameters
styleThe display style of push notifications.

◆ asyncUpdatePushNickname()

void io.agora.chat.PushManager.asyncUpdatePushNickname ( String nickname,
CallBack callback )

Updates the push display nickname of the current user.

This is an asynchronous method.

If no nickname is set, the user ID of the message sender, instead of the nickname, is indicated in the notification bar. The nickname can be different from the nickname in user attributes. However, Agora recommends that you use the same nickname for both. Therefore, if either nickname is updated, the other should be changed at the same time. For example, if you change the nickname in the user profile (UserInfoManager#updateOwnInfo(UserInfo, ValueCallBack) or UserInfoManager#updateOwnInfoByAttribute(UserInfo.UserInfoType, String, ValueCallBack)), remember to call this method to update the push nickname to ensure consistency.

Reference: The synchronous method see updatePushNickname(String).

Parameters
nicknameThe push nickname, which is different from the nickname in user profiles.

◆ bindDeviceToken()

void io.agora.chat.PushManager.bindDeviceToken ( String notifierName,
String deviceToken,
CallBack callBack )

Binds the device token to the chat server. If device token is null or "", the device token is unbound from the chat server.

Parameters
notifierNameThe current device ID: FCM - Sender ID; Hawei - App ID; Xiaomi - App ID; Meizu - App ID; OPPO - App Key; Vivo - App ID + "#" + App Key;
deviceTokenDevice token generated by the device manufacturer.
callBack

◆ clearRemindTypeForConversation()

void io.agora.chat.PushManager.clearRemindTypeForConversation ( String conversationId,
Conversation.ConversationType type,
CallBack callBack )

Clears the setting of offline push notification type for the conversation. After clearing, the conversation follows the settings of the current logged-in user PushManager#setSilentModeForAll(SilentModeParam, ValueCallBack).

Parameters
conversationIdThe conversation ID.
typeThe conversation type.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ getPreferredNotificationLanguage()

void io.agora.chat.PushManager.getPreferredNotificationLanguage ( ValueCallBack< String > callBack)

Gets the preferred notification language set by the user.

Parameters
callBackThe completion callback, which contains the description of the cause to the failure.

◆ getPushConfigs()

PushConfigs io.agora.chat.PushManager.getPushConfigs ( )

Gets the push configurations from the cache.

Returns
The push configurations.

◆ getPushConfigsFromServer()

PushConfigs io.agora.chat.PushManager.getPushConfigsFromServer ( ) throws ChatException

Gets the push configurations from the server.

This is a synchronous method and blocks the current thread.

Returns
The push configurations.
Exceptions
ChatExceptionA description of the cause of the exception.

◆ getPushTemplate()

void io.agora.chat.PushManager.getPushTemplate ( ValueCallBack< String > callBack)

Gets the push template for offline push notifications.

Parameters
callBackThe completion callback, which contains the description of the cause to the failure.

◆ getSilentModeForAll()

void io.agora.chat.PushManager.getSilentModeForAll ( ValueCallBack< SilentModeResult > callBack)

Gets the do-not-disturb settings of the current login user.

Parameters
callBackThe completion callback, which contains the description of the cause to the failure.

◆ getSilentModeForConversation()

void io.agora.chat.PushManager.getSilentModeForConversation ( String conversationId,
Conversation.ConversationType type,
ValueCallBack< SilentModeResult > callBack )

Gets the do-not-disturb settings of the conversation.

Parameters
conversationIdThe conversation ID.
typeThe conversation type.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ getSilentModeForConversations()

void io.agora.chat.PushManager.getSilentModeForConversations ( List< Conversation > conversationList,
ValueCallBack< Map< String, SilentModeResult > > callBack )

Gets the do-not-disturb settings of specified conversations in batches.

Parameters
conversationListThe conversation list.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ reportPushAction()

void io.agora.chat.PushManager.reportPushAction ( JSONObject json,
EMPushAction action,
CallBack callBack )

Reports the push events.

This is an asynchronous method.

Parameters
jsonValue The value of the EPush field included in the push data.
actionPush event.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ setPreferredNotificationLanguage()

void io.agora.chat.PushManager.setPreferredNotificationLanguage ( String languageCode,
CallBack callBack )

Sets the preferred language for push notifications.

Parameters
languageCodeThe language code.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ setPushTemplate()

void io.agora.chat.PushManager.setPushTemplate ( String templateName,
CallBack callBack )

Sets the push template for offline push notifications.

Parameters
templateNameThe name of the push template.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ setSilentModeForAll()

void io.agora.chat.PushManager.setSilentModeForAll ( SilentModeParam param,
ValueCallBack< SilentModeResult > callBack )

Sets the do-not-disturb mode for the current login user.

Parameters
paramThe do-not-disturb parameter.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ setSilentModeForConversation()

void io.agora.chat.PushManager.setSilentModeForConversation ( String conversationId,
Conversation.ConversationType type,
SilentModeParam param,
ValueCallBack< SilentModeResult > callBack )

Sets the do-not-disturb mode of the conversation.

Parameters
conversationIdThe conversation ID.
typeThe conversation type.
paramThe do-not-disturb parameter.
callBackThe completion callback, which contains the description of the cause to the failure.

◆ syncSilentModeConversationsFromServer()

void io.agora.chat.PushManager.syncSilentModeConversationsFromServer ( CallBack callBack)

Synchronizes the do-not-disturb status of the conversation with the server. Asynchronous method.

Parameters
callBackThe completion callback, which contains the description of the cause to the failure.

◆ updatePushDisplayStyle()

void io.agora.chat.PushManager.updatePushDisplayStyle ( DisplayStyle style) throws IllegalArgumentException, ChatException

Updates the display style of push notifications. The default value is DisplayStyle#SimpleBanner.

Reference: For the asynchronous method, see asyncUpdatePushDisplayStyle(DisplayStyle, CallBack).

This is a synchronous method and blocks the current thread.

Parameters
styleThe display style of push notifications.

◆ updatePushNickname()

boolean io.agora.chat.PushManager.updatePushNickname ( String nickname) throws IllegalArgumentException, ChatException

Updates the push display nickname of the current user. The nickname that is displayed in the push notification bar of the recipient's client when a message from the user is pushed. If no nickname is set, the user ID of the message sender, instead of the nickname, is indicated in the notification bar. The nickname can be different from the nickname in user attributes. However, Agora recommends that you use the same nickname for both. Therefore, if either nickname is updated, the other should be changed at the same time. For example, if you change the nickname in the user profile (UserInfoManager#updateOwnInfo(UserInfo, ValueCallBack) or UserInfoManager#updateOwnInfoByAttribute(UserInfo.UserInfoType, String, ValueCallBack)), remember to call this method to update the push nickname to ensure consistency.

For the asynchronous method, see asyncUpdatePushNickname(String, CallBack).

This is a synchronous method and blocks the current thread.

Parameters
nicknameThe push display nickname, which is different from the nickname in the user profile.

The documentation for this class was generated from the following file: