Class RemoteNotificationClient
-
- All Implemented Interfaces:
public final class RemoteNotificationClient
Provides an API interface for managing notification-related parameters with mobile services. The notification token is obtained using the FireBase (FCM) API or any push notification channel API. The ability to obtain the push token is not included as part of this interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
RemoteNotificationClient.CallbackListener
Interface for callback in the async operation.
public interface
RemoteNotificationClient.CallbackListenerWithResult
-
Constructor Summary
Constructors Constructor Description RemoteNotificationClient(OkHttpClient httpClient, SettingsParameters settingsParameters)
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient. RemoteNotificationClient(OkHttpClient httpClient)
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient. RemoteNotificationClient()
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient. RemoteNotificationClient(OkHttpClient httpClient, SettingsParameters settingsParameters, BasePushService.PushProvider pushProvider)
-
Method Summary
Modifier and Type Method Description final Unit
registerDeviceToken(String token, RemoteNotificationParameters parameters, RemoteNotificationClient.CallbackListener callbackListener)
Register the device token to the SAP mobile cloud. final Unit
unregisterDeviceToken(RemoteNotificationClient.CallbackListener callbackListener)
Unregister the device token from the destination url. final Unit
unregisterDeviceTokenSync(RemoteNotificationClient.CallbackListener callbackListener)
Unregister the device token from the destination url. final Unit
updateNotificationStatus(String notificationId, String status, RemoteNotificationClient.CallbackListener callbackListener)
Updates the notification status at the SAP mobile cloud. final Unit
subscribeTopics(String topics, RemoteNotificationClient.CallbackListener callbackListener)
final Unit
getAllSubscribedTopics(RemoteNotificationClient.CallbackListenerWithResult callbackListener)
final Unit
unsubscribeTopic(String topic, RemoteNotificationClient.CallbackListener callbackListener)
-
-
Constructor Detail
-
RemoteNotificationClient
RemoteNotificationClient(OkHttpClient httpClient, SettingsParameters settingsParameters)
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient.- Parameters:
httpClient
- an HttpClient implementation that can be used to communicate with mobile servicessettingsParameters
- settings parameter that contains information for destination and feedback url information
-
RemoteNotificationClient
RemoteNotificationClient(OkHttpClient httpClient)
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient.- Parameters:
httpClient
- an HttpClient implementation that can be used to communicate with mobile services
-
RemoteNotificationClient
RemoteNotificationClient()
Constructor that uses the url and setting parameter to create the instance of RemoteNotificationClient.
-
RemoteNotificationClient
RemoteNotificationClient(OkHttpClient httpClient, SettingsParameters settingsParameters, BasePushService.PushProvider pushProvider)
-
-
Method Detail
-
registerDeviceToken
final Unit registerDeviceToken(String token, RemoteNotificationParameters parameters, RemoteNotificationClient.CallbackListener callbackListener)
Register the device token to the SAP mobile cloud. This token is the one the application receives from the push provider for example FireBase(FCM).
- Parameters:
token
- the push token received from the FCM serverparameters
- This argument contains all the pus configuration related parameters like pushCapability and pushCategory information.callbackListener
- handle to CallbackListener to handle successful response or error<pre> **Example Usage:**<br></br> ` remoteNotificationClient.registerDeviceToken(token,parameter, new RemoteNotificationClient.CallbackListener() {
-
unregisterDeviceToken
final Unit unregisterDeviceToken(RemoteNotificationClient.CallbackListener callbackListener)
Unregister the device token from the destination url. The destination url is provided in the constructor.
- Parameters:
callbackListener
- handle to CallbackListener to handle successful response or error<pre> **Example Usage:**<br></br> ` remoteNotificationClient.unregisterDeviceToken( new RemoteNotificationClient.CallbackListener() {
-
unregisterDeviceTokenSync
@WorkerThread() final Unit unregisterDeviceTokenSync(RemoteNotificationClient.CallbackListener callbackListener)
Unregister the device token from the destination url. Note this method must be call in worker thread
-
updateNotificationStatus
final Unit updateNotificationStatus(String notificationId, String status, RemoteNotificationClient.CallbackListener callbackListener)
Updates the notification status at the SAP mobile cloud. Example for status are "received", "consumed" and "confirmed"
- Parameters:
notificationId
- Unique notification identifier contained the in the notification message payloadstatus
- The status to which the notification should be set to.callbackListener
- handle to CallbackListener to handle successful response or error<pre> **Example Usage:**<br></br> ` remoteNotificationClient.updateNotificationStatus( notificationId,"received", new RemoteNotificationClient.CallbackListener() {
-
subscribeTopics
final Unit subscribeTopics(String topics, RemoteNotificationClient.CallbackListener callbackListener)
-
getAllSubscribedTopics
final Unit getAllSubscribedTopics(RemoteNotificationClient.CallbackListenerWithResult callbackListener)
-
unsubscribeTopic
final Unit unsubscribeTopic(String topic, RemoteNotificationClient.CallbackListener callbackListener)
-
-
-
-