Package com.tapkey.mobile.manager
Interface PushNotificationManager
-
public interface PushNotificationManager
The PushNotificationManager takes care of incoming push notifications and updated registration tokens.
-
-
Field Summary
Fields Modifier and Type Field Description static String
TAPKEY_PUSH_NOTIFICATION_IDENTIFIER
Push notification data sent by Tapkey will contain this identifier as key.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Promise<Boolean>
receivedPushNotification(Map<String,String> data)
To be called, when a Tapkey push notification was received by the push notification provider.Promise<Void>
updateRegistrationToken(String pushNotificationRegistrationToken)
To be called, when the push notification registration token has changed.
-
-
-
Field Detail
-
TAPKEY_PUSH_NOTIFICATION_IDENTIFIER
static final String TAPKEY_PUSH_NOTIFICATION_IDENTIFIER
Push notification data sent by Tapkey will contain this identifier as key. This key can be used to identify Tapkey push notifications before passing the data to the PushNotificationManager:if (pushNotificationData.containsKey(PushNotificationManager.TAPKEY_PUSH_NOTIFICATION_IDENTIFIER)) { PushNotificationManager pushNotificationManager = tapkeyServiceFactory.getPushNotificationManager(); pushNotificationManager.receivedPushNotification(pushNotificationData) .conclude(); }
This allows the application to filter for Tapkey-specific messages before passing them to Tapkey. Nevertheless Tapkey ignores push notifications that do not contain this identifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
receivedPushNotification
Promise<Boolean> receivedPushNotification(Map<String,String> data)
To be called, when a Tapkey push notification was received by the push notification provider. Push notifications which don't belong to Tapkey will be ignored. After the push notification has been processed, the returned promise will resolve to true. Otherwise, if the push notification does not belong to the Tapkey Mobile SDK, the promise will resolve to false. In case of any other errors the promise completes with an exception.- Parameters:
data
- The payload data of the received push notification.- Returns:
- a promise that resolves true, when the push notification was processed.
-
updateRegistrationToken
Promise<Void> updateRegistrationToken(String pushNotificationRegistrationToken)
To be called, when the push notification registration token has changed.- Parameters:
pushNotificationRegistrationToken
- The new token- Returns:
- a promise that resolves when processing of the registration token has ben finished.
-
-