hyphenate_SDK3.0 4.0.0
hyphenate java IM SDK
Classes | Public Member Functions | List of all members
com.hyphenate.chat.EMPushManager Class Reference

Classes

enum  DisplayStyle
 
enum  EMPushAction
 
enum  EMPushRemindType
 

Public Member Functions

void enableOfflinePush () throws HyphenateException
 
void disableOfflinePush (int start, int end) throws HyphenateException
 
EMPushConfigs getPushConfigs ()
 
EMPushConfigs getPushConfigsFromServer () throws HyphenateException
 
void updatePushServiceForGroup (List< String > groupIds, boolean noPush) throws HyphenateException
 
void updatePushServiceForUsers (List< String > userIds, boolean noPush) throws HyphenateException
 
List< String > getNoPushGroups ()
 
List< String > getNoPushUsers ()
 
boolean updatePushNickname (String nickname) throws IllegalArgumentException, HyphenateException
 
void asyncUpdatePushNickname (String nickname, EMCallBack callback)
 
void updatePushDisplayStyle (DisplayStyle style) throws IllegalArgumentException, HyphenateException
 
void asyncUpdatePushDisplayStyle (DisplayStyle style, EMCallBack callback)
 
void setSilentModeForConversation (String conversationId, EMConversation.EMConversationType type, EMSilentModeParam param, EMValueCallBack< EMSilentModeResult > callBack)
 
void clearRemindTypeForConversation (String conversationId, EMConversation.EMConversationType type, EMCallBack callBack)
 
void getSilentModeForConversation (String conversationId, EMConversation.EMConversationType type, EMValueCallBack< EMSilentModeResult > callBack)
 
void setSilentModeForAll (EMSilentModeParam param, EMValueCallBack< EMSilentModeResult > callBack)
 
void getSilentModeForAll (EMValueCallBack< EMSilentModeResult > callBack)
 
void getSilentModeForConversations (List< EMConversation > conversationList, EMValueCallBack< Map< String, EMSilentModeResult > > callBack)
 
void setPreferredNotificationLanguage (String languageCode, EMCallBack callBack)
 
void getPreferredNotificationLanguage (EMValueCallBack< String > callBack)
 
synchronized void bindDeviceToken (String notifierName, String deviceToken, EMCallBack callBack)
 
void setPushTemplate (String templateName, EMCallBack callBack)
 
void getPushTemplate (EMValueCallBack< String > callBack)
 
void reportPushAction (JSONObject json, EMPushAction action, EMCallBack callBack)
 

Detailed Description

The message push configuration options.

Member Function Documentation

◆ asyncUpdatePushDisplayStyle()

void com.hyphenate.chat.EMPushManager.asyncUpdatePushDisplayStyle ( DisplayStyle  style,
EMCallBack  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 com.hyphenate.chat.EMPushManager.asyncUpdatePushNickname ( String  nickname,
EMCallBack  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 EMUserInfoManager#updateOwnInfoByAttribute(EMUserInfo.EMUserInfoType, String, EMValueCallBack) 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 com.hyphenate.chat.EMPushManager.bindDeviceToken ( String  notifierName,
String  deviceToken,
EMCallBack  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 com.hyphenate.chat.EMPushManager.clearRemindTypeForConversation ( String  conversationId,
EMConversation.EMConversationType  type,
EMCallBack  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 EMPushManager#setSilentModeForAll(EMSilentModeParam, EMValueCallBack).

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

◆ disableOfflinePush()

void com.hyphenate.chat.EMPushManager.disableOfflinePush ( int  start,
int  end 
) throws HyphenateException

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
HyphenateExceptionA description of the cause of the exception.
Deprecated:
Use EMPushManager#setSilentModeForAll(EMSilentModeParam, EMValueCallBack) instead.

◆ enableOfflinePush()

void com.hyphenate.chat.EMPushManager.enableOfflinePush ( ) throws HyphenateException

Turns on the push notification.

This is a synchronous method and blocks the current thread.

Exceptions
HyphenateException
Deprecated:
Use EMPushManager#setSilentModeForAll(EMSilentModeParam, EMValueCallBack) instead.

◆ getNoPushGroups()

List< String > com.hyphenate.chat.EMPushManager.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 EMPushManager#getSilentModeForConversation(String, EMConversation.EMConversationType, EMValueCallBack) instead,get the DND Settings for each conversation to determine

◆ getNoPushUsers()

List< String > com.hyphenate.chat.EMPushManager.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 EMPushManager#getSilentModeForConversation(String, EMConversation.EMConversationType, EMValueCallBack) instead,get the DND Settings for each conversation to determine.

◆ getPreferredNotificationLanguage()

void com.hyphenate.chat.EMPushManager.getPreferredNotificationLanguage ( EMValueCallBack< String >  callBack)

Gets the push translation language set by the user.

Parameters
callBackComplete the callback.

◆ getPushConfigs()

EMPushConfigs com.hyphenate.chat.EMPushManager.getPushConfigs ( )

Get the push configs from cache.

Returns
The push configs.

◆ getPushConfigsFromServer()

EMPushConfigs com.hyphenate.chat.EMPushManager.getPushConfigsFromServer ( ) throws HyphenateException

Get the push configs from the server.

This is a synchronous method and blocks the current thread.

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

◆ getPushTemplate()

void com.hyphenate.chat.EMPushManager.getPushTemplate ( EMValueCallBack< String >  callBack)

Gets the offline push template for Settings.

Parameters
callBackComplete the callback.

◆ getSilentModeForAll()

void com.hyphenate.chat.EMPushManager.getSilentModeForAll ( EMValueCallBack< EMSilentModeResult callBack)

Gets the DND Settings of the current login user.

Parameters
callBackComplete the callback.

◆ getSilentModeForConversation()

void com.hyphenate.chat.EMPushManager.getSilentModeForConversation ( String  conversationId,
EMConversation.EMConversationType  type,
EMValueCallBack< EMSilentModeResult callBack 
)

Gets the DND setting of the conversation.

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

◆ getSilentModeForConversations()

void com.hyphenate.chat.EMPushManager.getSilentModeForConversations ( List< EMConversation conversationList,
EMValueCallBack< Map< String, EMSilentModeResult > >  callBack 
)

Obtain the DND Settings of specified conversations in batches.

Parameters
conversationListThe conversation list.
callBackComplete the callback.

◆ reportPushAction()

void com.hyphenate.chat.EMPushManager.reportPushAction ( JSONObject  json,
EMPushAction  action,
EMCallBack  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 com.hyphenate.chat.EMPushManager.setPreferredNotificationLanguage ( String  languageCode,
EMCallBack  callBack 
)

Set user push translation language.

Parameters
languageCodelanguage code.
callBackComplete the callback.

◆ setPushTemplate()

void com.hyphenate.chat.EMPushManager.setPushTemplate ( String  templateName,
EMCallBack  callBack 
)

Set the push template for offline push.

Parameters
templateNametemplate name.
callBackComplete the callback.

◆ setSilentModeForAll()

void com.hyphenate.chat.EMPushManager.setSilentModeForAll ( EMSilentModeParam  param,
EMValueCallBack< EMSilentModeResult callBack 
)

Example Set the DND Settings for the current login user.

Parameters
paramPush DND parameters offline.
callBackComplete the callback.

◆ setSilentModeForConversation()

void com.hyphenate.chat.EMPushManager.setSilentModeForConversation ( String  conversationId,
EMConversation.EMConversationType  type,
EMSilentModeParam  param,
EMValueCallBack< EMSilentModeResult callBack 
)

Set the DND of the conversation.

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

◆ updatePushDisplayStyle()

void com.hyphenate.chat.EMPushManager.updatePushDisplayStyle ( DisplayStyle  style) throws IllegalArgumentException, HyphenateException

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

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

This is a synchronous method and blocks the current thread.

Parameters
styleThe push message display style.

◆ updatePushNickname()

boolean com.hyphenate.chat.EMPushManager.updatePushNickname ( String  nickname) throws IllegalArgumentException, HyphenateException

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 EMUserInfoManager#updateOwnInfoByAttribute(EMUserInfo.EMUserInfoType, String, EMValueCallBack) to set}, be sure to also call this method to update to prevent the display differences.

Reference: The asynchronous method see asyncUpdatePushNickname(String, EMCallBack)

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 com.hyphenate.chat.EMPushManager.updatePushServiceForGroup ( List< String >  groupIds,
boolean  noPush 
) throws HyphenateException

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
HyphenateExceptionA description of the cause of the exception.
Deprecated:
Use EMPushManager#setSilentModeForConversation(String, EMConversation.EMConversationType, EMSilentModeParam, EMValueCallBack) instead,set DND Settings for each session.

◆ updatePushServiceForUsers()

void com.hyphenate.chat.EMPushManager.updatePushServiceForUsers ( List< String >  userIds,
boolean  noPush 
) throws HyphenateException

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
HyphenateExceptionA description of the cause of the exception.
Deprecated:
Use EMPushManager#setSilentModeForConversation(String, EMConversation.EMConversationType, EMSilentModeParam, EMValueCallBack) instead,set DND Settings for each session

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