Chat SDK for Android v1.2.1
agora java chat SDK
|
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) |
The message push configuration options.
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).
style | The display style of push notifications. |
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).
nickname | The push nickname, which is different from the nickname in user profiles. |
synchronized 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.
notifierName | The current device ID: FCM - Sender ID; Hawei - App ID; Xiaomi - App ID; Meizu - App ID; OPPO - App Key; Vivo - App ID + "#" + App Key; |
deviceToken | Device token generated by the device manufacture. |
callBack |
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).
conversationId | The conversation ID. |
type | The conversation type. |
callBack | The completion callback, which contains the description of the cause to the failure. |
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.
start | The start hour. |
end | The end hour. |
ChatException | A description of the cause of the exception. |
void io.agora.chat.PushManager.enableOfflinePush | ( | ) | throws ChatException |
Turns on the offline push notification.
This is a synchronous method and blocks the current thread.
ChatException |
List< String > io.agora.chat.PushManager.getNoPushGroups | ( | ) |
Gets the list of groups for which the offline push notification is turned off.
This is a synchronous method and blocks the current thread.
List< String > io.agora.chat.PushManager.getNoPushUsers | ( | ) |
Gets the list of user IDs with the offline push notification turned off from the cache.
Note: If you need to get the latest data, call {@Link EmpushManager# getPushConfigsFromServer()} before calling this method.
void io.agora.chat.PushManager.getPreferredNotificationLanguage | ( | ValueCallBack< String > | callBack | ) |
Gets the preferred notification language set by the user.
callBack | The completion callback, which contains the description of the cause to the failure. |
PushConfigs io.agora.chat.PushManager.getPushConfigs | ( | ) |
Gets the push configurations from the cache.
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.
ChatException | A description of the cause of the exception. |
void io.agora.chat.PushManager.getPushTemplate | ( | ValueCallBack< String > | callBack | ) |
Gets the push template for offline push notifications.
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.getSilentModeForAll | ( | ValueCallBack< SilentModeResult > | callBack | ) |
Gets the do-not-disturb settings of the current login user.
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.getSilentModeForConversation | ( | String | conversationId, |
Conversation.ConversationType | type, | ||
ValueCallBack< SilentModeResult > | callBack | ||
) |
Gets the do-not-disturb settings of the conversation.
conversationId | The conversation ID. |
type | The conversation type. |
callBack | The completion callback, which contains the description of the cause to the failure. |
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.
conversationList | The conversation list. |
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.reportPushAction | ( | JSONObject | json, |
EMPushAction | action, | ||
CallBack | callBack | ||
) |
Reports the push events.
This is an asynchronous method.
json | Value The value of the EPush field included in the push data. |
action | Push event. |
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.setPreferredNotificationLanguage | ( | String | languageCode, |
CallBack | callBack | ||
) |
Sets the preferred language for push notifications.
languageCode | The language code. |
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.setPushTemplate | ( | String | templateName, |
CallBack | callBack | ||
) |
Sets the push template for offline push notifications.
templateName | The name of the push template. |
callBack | The completion callback, which contains the description of the cause to the failure. |
void io.agora.chat.PushManager.setSilentModeForAll | ( | SilentModeParam | param, |
ValueCallBack< SilentModeResult > | callBack | ||
) |
Sets the do-not-disturb mode for the current login user.
param | The do-not-disturb parameter. |
callBack | The completion callback, which contains the description of the cause to the failure. |
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.
conversationId | The conversation ID. |
type | The conversation type. |
param | The do-not-disturb parameter. |
callBack | The completion callback, which contains the description of the cause to the failure. |
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.
style | The display style of push notifications. |
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.
nickname | The push display nickname, which is different from the nickname in the user profile. |
void io.agora.chat.PushManager.updatePushServiceForGroup | ( | List< String > | groupIds, |
boolean | noPush | ||
) | throws ChatException |
Sets whether to turn on the offline push notification for the the specified groups.
This is a synchronous method and blocks the current thread.
groupIds | The list of groups. |
noPush | - true : Turns off the notification;
|
ChatException | A description of the cause of the exception. |
void io.agora.chat.PushManager.updatePushServiceForUsers | ( | List< String > | userIds, |
boolean | noPush | ||
) | throws ChatException |
Sets whether to turn on the offline push notification for specified users.
userIds | The list of users. |
noPush | - true :turns off the notification;
|
ChatException | A description of the cause of the exception. |