public class PushServerClient extends Object
| Constructor and Description |
|---|
PushServerClient()
Default constructor.
|
PushServerClient(String serviceBaseUrl)
Constructor with a push server base URL.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUsersToCampaign(Long campaignId,
List<String> users)
Add a list of users to a specific campaign
|
io.getlime.core.rest.model.base.response.ObjectResponse<CreateCampaignResponse> |
createCampaign(Long appId,
PushMessageBody message)
Create a campaign.
|
boolean |
createDevice(Long appId,
String token,
MobilePlatform platform)
Register anonymous device to the push server.
|
boolean |
createDevice(Long appId,
String token,
MobilePlatform platform,
String activationId)
Register device associated with activation ID to the push server.
|
boolean |
deleteCampaign(Long campaignId)
Delete a campaign specified with campaignId.
|
boolean |
deleteDevice(Long appId,
String token)
Remove device from the push server
|
boolean |
deleteUsersFromCampaign(Long campaignId,
List<String> users)
Delete a list of users from specific campaign.
|
io.getlime.core.rest.model.base.response.ObjectResponse<CampaignResponse> |
getCampaign(Long campaignId)
Get a campaign specified with campaignID.
|
io.getlime.core.rest.model.base.response.ObjectResponse<ListOfCampaignsResponse> |
getListOfCampaigns(boolean all)
Get list of campaigns, dependent on all param
|
PagedResponse<ListOfUsersFromCampaignResponse> |
getListOfUsersFromCampaign(Long campaignId,
int page,
int size)
Get a list of users in paged format from specific campaign
|
io.getlime.core.rest.model.base.response.ObjectResponse<ServiceStatusResponse> |
getServiceStatus()
Returns service information
|
boolean |
sendCampaign(Long campaignId)
Send a specific campaign to users carrying this campaignID in PushCampaignUser model, but only once per device identified by token.
|
io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> |
sendPushMessage(Long appId,
PushMessage pushMessage)
Send a single push message to application with given ID.
|
io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> |
sendPushMessageBatch(Long appId,
List<PushMessage> batch)
Send a push message batch to application with given ID.
|
boolean |
sendTestCampaign(Long campaignId,
String userId)
Send a campaign on test user for trying its correctness.
|
void |
setServiceBaseUrl(String serviceBaseUrl)
Set the service base URL.
|
boolean |
updateDeviceStatus(String activationId)
Update activation status for given device registration.
|
public PushServerClient()
public PushServerClient(String serviceBaseUrl)
serviceBaseUrl - URL pointing to the running push server instance, for example "http://localhost:8080/powerauth-push-server".public void setServiceBaseUrl(String serviceBaseUrl)
serviceBaseUrl - Base URL.public io.getlime.core.rest.model.base.response.ObjectResponse<ServiceStatusResponse> getServiceStatus() throws PushServerClientException
PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean createDevice(Long appId, String token, MobilePlatform platform) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider (APNs, FCM).platform - Mobile platform (iOS, Android).PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean createDevice(Long appId, String token, MobilePlatform platform, String activationId) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider (APNs, FCM).platform - Mobile platform (iOS, Android).activationId - PowerAuth 2.0 activation ID.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteDevice(Long appId, String token) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean updateDeviceStatus(String activationId) throws PushServerClientException
activationId - Identifier of activationPushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> sendPushMessage(Long appId, PushMessage pushMessage) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.pushMessage - Push message to be sent.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> sendPushMessageBatch(Long appId, List<PushMessage> batch) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.batch - Push message batch to be sent.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<CreateCampaignResponse> createCampaign(Long appId, PushMessageBody message) throws PushServerClientException
appId - Application ID.message - Message which attributes are defined in PushMessageBody.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteCampaign(Long campaignId) throws PushServerClientException
campaignId - Campaign ID.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<ListOfCampaignsResponse> getListOfCampaigns(boolean all) throws PushServerClientException
all - true to get whole list, false to get campaigns that are only sentPushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<CampaignResponse> getCampaign(Long campaignId) throws PushServerClientException
campaignId - ID of campaign to get.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean addUsersToCampaign(Long campaignId, List<String> users) throws PushServerClientException
campaignId - Identifier of campaign.users - List of users to add.PushServerClientException - In case of network, response / JSON processing, or other IO error.public PagedResponse<ListOfUsersFromCampaignResponse> getListOfUsersFromCampaign(Long campaignId, int page, int size) throws PushServerClientException
campaignId - Identifier of campaign.page - Page number.size - Size of elements per page.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteUsersFromCampaign(Long campaignId, List<String> users) throws PushServerClientException
campaignId - Identifier of campaign.users - List of users' Identifiers to delete.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean sendTestCampaign(Long campaignId, String userId) throws PushServerClientException
campaignId - Identifier of campaign.userId - Identifier of test user.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean sendCampaign(Long campaignId) throws PushServerClientException
campaignId - Identifier of campaign.PushServerClientException - In case of network, response / JSON processing, or other IO error.Copyright © 2016–2018 Lime - HighTech Solutions Inc.. All rights reserved.