Interface PushClient
public interface PushClient
The push client is used to send the notification and retrieve the
notification status.
-
Method Summary
Modifier and TypeMethodDescriptionbulkPush(LocalizedPushPayload rootNotification, Collection<LocalizedUserNotification> userNotifications) Triggers notifications to device registrations with a capability and form factor.bulkPush(PushPayload rootNotification, Collection<UserNotification> userNotifications) Triggers a bulk of notifications.getLocalizations(Collection<String> userIds) Retrieve the set of locales for a set of user ids and their registered locale.getNotificationStatus(String notificationId) Retrieve the notification status by its ID.getRegistration(String registrationId) Get a device registration by it's ID.default PushRegistrationsResponseGet all registrations for a mobile application.getRegistrations(Optional<String> usernameOpt, Optional<String> groupOpt) Get registrations by optional username and/or optional group.default PushRegistrationsResponsegetRegistrationsByGroup(String group) Get registrations by a group.default PushRegistrationsResponsegetRegistrationsByUsername(String username) Get registrations by a username.pushToApplication(LocalizedPushPayload pushPayload) Triggers a notification to all registered users of an application.pushToApplication(PushPayload pushPayload) Triggers a notification to all registered users of an application.pushToCapability(String capability, LocalizedPushToCapabilitiesPayload pushToCapabilitiesPayload) Triggers notifications to devices that have been registered with a certain capability.pushToCapability(String capability, PushToCapabilitiesPayload pushToCapabilitiesPayload) Triggers notifications to devices that have been registered with a certain capability.pushToDevice(String userId, String deviceId, LocalizedPushPayload pushPayload) Triggers a notification to a single device, identified by userId and deviceId.pushToDevice(String userId, String deviceId, PushPayload pushPayload) Triggers a notification to a single device, identified by userId and deviceId.pushToGroup(String group, LocalizedPushPayload pushPayload) Triggers a notification to a group with the same payload for all recipients.pushToGroup(String group, PushPayload pushPayload) Triggers a notification to a group with the same payload for all recipients.pushToTopics(Collection<String> userIds, Collection<String> topics, LocalizedPushPayload pushPayload) Triggers notifications to devices that have an active subscription for any of the given topicpushToTopics(Collection<String> userIds, Collection<String> userUUIDs, Collection<String> topics, LocalizedPushPayload pushPayload) Triggers notifications to devices that have an active subscription for any of the given topicpushToUsers(Collection<String> userIds, LocalizedPushPayload pushPayload) Triggers a notification to a defined set of users, identified by their userId.pushToUsers(Collection<String> userIds, PushPayload pushPayload) Triggers a notification to a defined set of users, identified by their userId.pushToUsers(Collection<String> userIds, Collection<String> userUUIDs, LocalizedPushPayload pushPayload) Triggers a notification to a defined set of users, identified by their userId or global user ID.
-
Method Details
-
pushToApplication
Triggers a notification to all registered users of an application.- Parameters:
pushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToApplication
Triggers a notification to all registered users of an application.- Parameters:
pushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToDevice
PushResponse pushToDevice(String userId, String deviceId, PushPayload pushPayload) throws ClientException Triggers a notification to a single device, identified by userId and deviceId.- Parameters:
userId- userIddeviceId- deviceIdpushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToDevice
PushResponse pushToDevice(String userId, String deviceId, LocalizedPushPayload pushPayload) throws ClientException Triggers a notification to a single device, identified by userId and deviceId.- Parameters:
userId- userIddeviceId- deviceIdpushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToUsers
PushResponse pushToUsers(Collection<String> userIds, PushPayload pushPayload) throws ClientException Triggers a notification to a defined set of users, identified by their userId. If a single user has multiple devices registered, all devices will receive the notification.- Parameters:
userIds- userIdspushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToUsers
PushResponse pushToUsers(Collection<String> userIds, LocalizedPushPayload pushPayload) throws ClientException Triggers a notification to a defined set of users, identified by their userId. If a single user has multiple devices registered, all devices will receive the notification.- Parameters:
userIds- userIdspushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToUsers
PushResponse pushToUsers(Collection<String> userIds, Collection<String> userUUIDs, LocalizedPushPayload pushPayload) throws ClientException Triggers a notification to a defined set of users, identified by their userId or global user ID. If a single user has multiple devices registered, all devices will receive the notification.- Parameters:
userIds- userIdsuserUUIDs- userUUIDspushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToGroup
Triggers a notification to a group with the same payload for all recipients.- Parameters:
group- grouppushPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToGroup
Triggers a notification to a group with the same payload for all recipients.- Parameters:
group- grouppushPayload- payload- Returns:
- response
- Throws:
ClientException
-
bulkPush
Triggers a bulk of notifications. The notifications are temporarily queued before handed over to the push providers- Parameters:
rootNotification- fallback notification objectuserNotifications- user notification objects- Returns:
- response
-
bulkPush
PushResponse bulkPush(LocalizedPushPayload rootNotification, Collection<LocalizedUserNotification> userNotifications) Triggers notifications to device registrations with a capability and form factor.- Parameters:
rootNotification- fallback notification objectuserNotifications- user notification objects- Returns:
- response
-
pushToCapability
PushResponse pushToCapability(String capability, PushToCapabilitiesPayload pushToCapabilitiesPayload) throws ClientException Triggers notifications to devices that have been registered with a certain capability.- Parameters:
capability- capabilitypushToCapabilitiesPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToCapability
PushResponse pushToCapability(String capability, LocalizedPushToCapabilitiesPayload pushToCapabilitiesPayload) throws ClientException Triggers notifications to devices that have been registered with a certain capability.- Parameters:
capability- capabilitypushToCapabilitiesPayload- payload- Returns:
- response
- Throws:
ClientException
-
pushToTopics
PushResponse pushToTopics(Collection<String> userIds, Collection<String> topics, LocalizedPushPayload pushPayload) Triggers notifications to devices that have an active subscription for any of the given topic- Parameters:
userIds- optional filter on userIdstopics- List of topicspushPayload- payload- Returns:
-
pushToTopics
PushResponse pushToTopics(Collection<String> userIds, Collection<String> userUUIDs, Collection<String> topics, LocalizedPushPayload pushPayload) Triggers notifications to devices that have an active subscription for any of the given topic- Parameters:
userIds- optional filter on userIdsuserUUIDs- optional filter on global user IDstopics- List of topicspushPayload- payload- Returns:
-
getNotificationStatus
Retrieve the notification status by its ID.- Parameters:
notificationId- notificationId- Returns:
- response
-
getLocalizations
Retrieve the set of locales for a set of user ids and their registered locale. If userIds is null, all registered locales are returned.- Parameters:
userIds- userIds- Returns:
- set of locales
-
getRegistration
Get a device registration by it's ID.- Parameters:
registrationId- ID of the registration- Returns:
- Optional, which is empty, if no registration was found for the given ID.
-
getRegistrations
Get all registrations for a mobile application.- Returns:
- List of registrations.
-
getRegistrationsByUsername
Get registrations by a username.- Parameters:
username- username to search registrations for.- Returns:
- List of registrations.
-
getRegistrationsByGroup
Get registrations by a group.- Parameters:
group- group to search registrations for.- Returns:
- List of registrations.
-
getRegistrations
Get registrations by optional username and/or optional group.- Parameters:
usernameOpt- optional usernamegroupOpt- otpional group- Returns:
- List of registrations.
-