public static class SendBird.HMS
extends java.lang.Object
Constructor and Description |
---|
HMS() |
Modifier and Type | Method and Description |
---|---|
static void |
getDoNotDisturb(SendBird.GetDoNotDisturbHandler handler)
Gets Do-not-disturb option for the current
User . |
static void |
getMyPushTokensByToken(java.lang.String token,
SendBird.PushTokenType type,
SendBird.GetPushTokensHandler handler)
Requests push tokens of current user from given token.
|
static java.lang.String |
getPendingPushToken()
Gets the pending HMS push token.
|
static void |
getPushSound(SendBird.GetPushSoundHandler handler)
Gets push notification sound path for the current
User . |
static void |
getPushTemplate(SendBird.GetPushTemplateHandler handler)
Gets push template option for the current
User . |
static void |
getPushTriggerOption(SendBird.GetPushTriggerOptionHandler handler)
Gets the current
User 's push trigger option. |
static void |
getSnoozePeriod(SendBird.GetSnoozePeriodHandler handler)
Gets snooze period for the current
User . |
static void |
registerPushTokenForCurrentUser(java.lang.String token,
boolean unique,
SendBird.RegisterPushTokenWithStatusHandler handler)
Registers push token for the current
User to receive push notification. |
static void |
registerPushTokenForCurrentUser(java.lang.String token,
SendBird.RegisterPushTokenWithStatusHandler handler)
Registers push token for the current
User to receive push notification. |
static void |
setDoNotDisturb(boolean doNotDisturbOn,
int startHour,
int startMin,
int endHour,
int endMin,
java.lang.String timezone,
SendBird.SetDoNotDisturbHandler handler)
Sets Do-not-disturb option for the current
User . |
static void |
setPushSound(java.lang.String sound,
SendBird.SetPushSoundHandler handler)
Sets the push notification sound file path for the current
User . |
static void |
setPushTemplate(java.lang.String templateName,
SendBird.SetPushTemplateHandler handler)
Sets push template option for the current
User . |
static void |
setPushTriggerOption(SendBird.PushTriggerOption pushTriggerOption,
SendBird.SetPushTriggerOptionHandler handler)
Sets the current
User 's push trigger option. |
static void |
setSnoozePeriod(boolean snoozeOn,
long startTs,
long endTs,
SendBird.SetSnoozePeriodHandler handler)
Sets snooze period for the current
User . |
static void |
unregisterPushTokenAllForCurrentUser(SendBird.UnregisterPushTokenHandler handler)
Unregisters all push token bound to the current
User . |
static void |
unregisterPushTokenForCurrentUser(java.lang.String token,
SendBird.UnregisterPushTokenHandler handler)
Unregisters push token for the current
User . |
public static java.lang.String getPendingPushToken()
null
if there is no registration pending token.public static void registerPushTokenForCurrentUser(java.lang.String token, SendBird.RegisterPushTokenWithStatusHandler handler)
User
to receive push notification.
To enable push notification and get a token, refer to SendBird Docs.SendBird.connect(String, ConnectHandler)
, SendBird.connect(String, String, ConnectHandler)
) is made.
Otherwise, callback will return with SendBird.PushTokenRegistrationStatus.PENDING
status. Then you can register push token again by calling this method with
getPendingPushToken()
as the token parameter, after the connection is done.
This just adds token to the server. If you want to register this token and delete all the previous ones, refer to SendBird.registerPushTokenForCurrentUser(String, boolean, RegisterPushTokenWithStatusHandler)
.token
- HMS push token.handler
- Callback handler.public static void registerPushTokenForCurrentUser(java.lang.String token, boolean unique, SendBird.RegisterPushTokenWithStatusHandler handler)
User
to receive push notification.
To enable push notification and get a token, refer to SendBird Docs.SendBird.connect(String, ConnectHandler)
, SendBird.connect(String, String, ConnectHandler)
) is made.
Otherwise, callback will return with SendBird.PushTokenRegistrationStatus.PENDING
status. Then you can register push token again by calling this method with
getPendingPushToken()
as the token parameter, after the connection is done.token
- HMS push token.unique
- If true, all the previously registered token for the current User
will be deleted and this token will be the unique one.handler
- Callback handler.public static void unregisterPushTokenForCurrentUser(java.lang.String token, SendBird.UnregisterPushTokenHandler handler)
User
.token
- HMS push token.handler
- Callback handler.public static void unregisterPushTokenAllForCurrentUser(SendBird.UnregisterPushTokenHandler handler)
User
.handler
- Callback handler.public static void getMyPushTokensByToken(java.lang.String token, SendBird.PushTokenType type, SendBird.GetPushTokensHandler handler)
handler
.token
- Token to get next push tokens. If token is null
, the result will be passed from the beginning.type
- PushTokenType. Refer to SendBird.PushTokenType
.handler
- Callback handler.public static void setDoNotDisturb(boolean doNotDisturbOn, int startHour, int startMin, int endHour, int endMin, java.lang.String timezone, SendBird.SetDoNotDisturbHandler handler)
User
.
If this option is enabled, the current User
does not receive push notification during the specified time repeatedly.
If you want to snooze specific period, use SendBird.setSnoozePeriod(boolean, long, long, SetSnoozePeriodHandler)
.doNotDisturbOn
- Enables option or not.startHour
- Start hour (0~23).startMin
- Start minute (0~59).endHour
- End hour (0~23).endMin
- End minute (0~59).timezone
- Timezone. TimeZone.getID()
can be used to get the current timezone.handler
- Callback handler.public static void getDoNotDisturb(SendBird.GetDoNotDisturbHandler handler)
User
.handler
- Callback handler.public static void setSnoozePeriod(boolean snoozeOn, long startTs, long endTs, SendBird.SetSnoozePeriodHandler handler)
User
.
If this option is enabled, the current User
does not receive push notification during the given period. It's not a repetitive operation.
If you want to snooze repeatedly, use SendBird.setDoNotDisturb(boolean, int, int, int, int, String, SetDoNotDisturbHandler)
.snoozeOn
- Enables option or not.startTs
- Start timestamp of snooze periodendTs
- End timestamp of snooze periodhandler
- Callback handler.public static void getSnoozePeriod(SendBird.GetSnoozePeriodHandler handler)
User
.handler
- Callback handler.public static void setPushSound(java.lang.String sound, SendBird.SetPushSoundHandler handler)
User
.
This setting will be delivered on push notification payload.sound
- Sound file path.handler
- Callback handler.public static void getPushSound(SendBird.GetPushSoundHandler handler)
User
.handler
- Callback handler.public static void setPushTemplate(java.lang.String templateName, SendBird.SetPushTemplateHandler handler)
User
. The only valid arguments for template name are SendBird.PUSH_TEMPLATE_DEFAULT
and SendBird.PUSH_TEMPLATE_ALTERNATIVE
.
If SendBird.PUSH_TEMPLATE_DEFAULT
is set, the push notification will contain the original message in the message
field of the push notification.
If SendBird.PUSH_TEMPLATE_ALTERNATIVE
is set, message
of push notification will be replaced by the content you've set on
SendBird Dashboard.templateName
- Name of template to be applied to current User
.handler
- Callback handler.public static void getPushTemplate(SendBird.GetPushTemplateHandler handler)
User
. For details of push template option, refer to SendBird.setPushTemplate(String, SetPushTemplateHandler)
.
This can be used, for instance, when you need to check the push notification content preview is on or off at the moment.handler
- Callback handler.public static void setPushTriggerOption(SendBird.PushTriggerOption pushTriggerOption, SendBird.SetPushTriggerOptionHandler handler)
User
's push trigger option.
If certain channel's push trigger option is set to GroupChannel.PushTriggerOption.DEFAULT
, it works according to the state of SendBird.PushTriggerOption
.
If not, push messages will be triggered according to the state of GroupChannel.PushTriggerOption
.
Refer to GroupChannel.PushTriggerOption
.pushTriggerOption
- PushTriggerOption
. Refer to SendBird.PushTriggerOption
.handler
- Callback handler.public static void getPushTriggerOption(SendBird.GetPushTriggerOptionHandler handler)
User
's push trigger option. Refer to SendBird.PushTriggerOption
.
For details of push trigger option, refer to SendBird.setPushTriggerOption(SendBird.PushTriggerOption, SetPushTriggerOptionHandler)
.handler
- Callback handler. Copyright © 2021, Sendbird or its affiliates. All rights reserved.
Report a bug or request a feature
For further developer documentation, see Chat SDK Documentation. That documentation contains more detailed descriptions, conceptual overviews, definitions of terms, and code examples.