Chat SDK for Android v1.2.1
agora java chat SDK
Classes | Public Member Functions | List of all members
io.agora.chat.PushManager Class Reference

Classes

enum  DisplayStyle
 
enum  EMPushAction
 
enum  PushRemindType
 

Public Member Functions

void enableOfflinePush () throws ChatException
 
void disableOfflinePush (int start, int end) throws ChatException
 
PushConfigs getPushConfigs ()
 
PushConfigs getPushConfigsFromServer () throws ChatException
 
void updatePushServiceForGroup (List< String > groupIds, boolean noPush) throws ChatException
 
void updatePushServiceForUsers (List< String > userIds, boolean noPush) throws ChatException
 
List< String > getNoPushGroups ()
 
List< String > getNoPushUsers ()
 
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 setPreferredNotificationLanguage (String languageCode, CallBack callBack)
 
void getPreferredNotificationLanguage (ValueCallBack< String > callBack)
 
synchronized 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 message push configuration options.

Member Function Documentation

◆ asyncUpdatePushDisplayStyle()

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

Update the push message style. The default value is DisplayStyle#SimpleBanner.

This is an asynchronous method.

Reference: The synchronous method see updatePushDisplayStyle(DisplayStyle)

Parameters
styleThe push message style.

◆ asyncUpdatePushNickname()

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

Update the push display nickname of the current user.

This is an asynchronous method.

This method can be used to set a push nickname, the push nickname will be used for offline push notification. When the user changes the nickname in the user profile(use or UserInfoManager#updateOwnInfoByAttribute(UserInfo.UserInfoType, String, ValueCallBack) to set), be sure to also call this method to update the display nickname to prevent the display differences.

Reference: The synchronous method see updatePushNickname(String).

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

◆ bindDeviceToken()

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

Binds device token to chat server. If device token is null or "", means that unbinding device token from chat server.

Parameters
notifierNameMeans current device ID, follow: 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 manufacture
callBack

◆ clearRemindTypeForConversation()

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

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

Parameters
conversationIdThe conversation id.
typeThe conversation type.
callBackComplete the callback.

◆ disableOfflinePush()

void io.agora.chat.PushManager.disableOfflinePush ( int  start,
int  end 
) throws ChatException

Do not push the offline messages within the specified time period (24-hour clock).

This is a synchronous method and blocks the current thread.

Parameters
startThe start hour.
endThe end hour.
Exceptions
ChatExceptionA description of the cause of the exception.
Deprecated:
Use PushManager#setSilentModeForAll(SilentModeParam, ValueCallBack) instead.

◆ enableOfflinePush()

void io.agora.chat.PushManager.enableOfflinePush ( ) throws ChatException

Turns on the push notification.

This is a synchronous method and blocks the current thread.

Exceptions
ChatException
Deprecated:
Use PushManager#setSilentModeForAll(SilentModeParam, ValueCallBack) instead.

◆ getNoPushGroups()

List< String > io.agora.chat.PushManager.getNoPushGroups ( )

Gets the list of groups which have blocked the push notification.

This is a synchronous method and blocks the current thread.

Returns
The list of groups that blocked the push notification.
Deprecated:
Use PushManager#getSilentModeForConversation(String, Conversation.ConversationType, ValueCallBack) instead,get the DND Settings for each conversation to determine

◆ getNoPushUsers()

List< String > io.agora.chat.PushManager.getNoPushUsers ( )

Gets the list of user ID which have blocked the push notification from the cache.

Note: If you needs to get the latest data, call {@Link EmpushManager# getPushConfigsFromServer()} before calling this method.

Returns
The list of users who have blocked the push notification.
Deprecated:
Use PushManager#getSilentModeForConversation(String, Conversation.ConversationType, ValueCallBack) instead,get the DND Settings for each conversation to determine.

◆ getPreferredNotificationLanguage()

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

Gets the push translation language set by the user.

Parameters
callBackComplete the callback.

◆ getPushConfigs()

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

Get the push configs from cache.

Returns
The push configs.

◆ getPushConfigsFromServer()

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

Get the push configs from the server.

This is a synchronous method and blocks the current thread.

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

◆ getPushTemplate()

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

Gets the offline push template for Settings.

Parameters
callBackComplete the callback.

◆ getSilentModeForAll()

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

Gets the DND Settings of the current login user.

Parameters
callBackComplete the callback.

◆ getSilentModeForConversation()

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

Gets the DND setting of the conversation.

Parameters
conversationIdThe conversation id.
typeThe conversation type.
callBackComplete the callback.

◆ getSilentModeForConversations()

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

Obtain the DND Settings of specified conversations in batches.

Parameters
conversationListThe conversation list.
callBackComplete the callback.

◆ reportPushAction()

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

Reports the push events.

This is an asynchronous method.

Parameters
jsonValue corresponding to the EPush field carried in the push data.
actionPush event
callBackComplete the callback.

◆ setPreferredNotificationLanguage()

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

Set user push translation language.

Parameters
languageCodelanguage code.
callBackComplete the callback.

◆ setPushTemplate()

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

Set the push template for offline push.

Parameters
templateNametemplate name.
callBackComplete the callback.

◆ setSilentModeForAll()

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

Example Set the DND Settings for the current login user.

Parameters
paramPush DND parameters offline.
callBackComplete the callback.

◆ setSilentModeForConversation()

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

Set the DND of the conversation.

Parameters
conversationIdThe conversation id.
typeThe conversation type.
paramPush DND parameters offline.
callBackComplete the callback.

◆ updatePushDisplayStyle()

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

Update the push message style. The default value is DisplayStyle#SimpleBanner.

Reference: The asynchronous method see asyncUpdatePushDisplayStyle(DisplayStyle, CallBack)

This is a synchronous method and blocks the current thread.

Parameters
styleThe push message display style.

◆ updatePushNickname()

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

Updates the push display nickname of the current user. This method can be used to set a push display nickname, the push display nickname will be used to show for offline push notification. When the app user changes the nickname in the user profile(use or UserInfoManager#updateOwnInfoByAttribute(UserInfo.UserInfoType, String, ValueCallBack) to set}, be sure to also call this method to update to prevent the display differences.

Reference: 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.

◆ updatePushServiceForGroup()

void io.agora.chat.PushManager.updatePushServiceForGroup ( List< String >  groupIds,
boolean  noPush 
) throws ChatException

Sets whether to turn on or turn off the push notification for the the specified groups.

This is a synchronous method and blocks the current thread.

Parameters
groupIdsThe list of groups to be set.
noPush- true: Turns off the notification;
  • false: Turns on the notification.
Exceptions
ChatExceptionA description of the cause of the exception.
Deprecated:
Use PushManager#setSilentModeForConversation(String, Conversation.ConversationType, SilentModeParam, ValueCallBack) instead,set DND Settings for each session.

◆ updatePushServiceForUsers()

void io.agora.chat.PushManager.updatePushServiceForUsers ( List< String >  userIds,
boolean  noPush 
) throws ChatException

Sets whether the specified group accepts the offline message notification.

Parameters
userIdsThe list of users to be set.
noPush- true:turn off the notification;
  • false:turn on the notification.
Exceptions
ChatExceptionA description of the cause of the exception.
Deprecated:
Use PushManager#setSilentModeForConversation(String, Conversation.ConversationType, SilentModeParam, ValueCallBack) instead,set DND Settings for each session

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