Class PushSubscription
java.lang.Object
com.codename1.push.PushSubscription
Immutable native registration produced by a push transport.
The token is opaque provider data. Applications should send the complete subscription to their server and must not parse, truncate, or use the token as a user identity. Providers can rotate tokens, so a later registration for the same installation replaces the earlier value.
-
Constructor Summary
ConstructorsConstructorDescriptionPushSubscription(String transportId, String token, String platform, String installationId, long expiresAt, List<String> capabilities) Creates a subscription, primarily for customPushTransportimplementations. -
Method Summary
Modifier and TypeMethodDescriptionReturns transport capability identifiers.longReturns the subscription expiry time.Returns the stable ID for this application installation.Returns the Codename One platform name reported at registration.getToken()Returns the opaque native provider token.Returns the provider identifier used for delivery routing.
-
Constructor Details
-
PushSubscription
public PushSubscription(String transportId, String token, String platform, String installationId, long expiresAt, List<String> capabilities) Creates a subscription, primarily for customPushTransportimplementations.- Parameters:
transportId- stable provider identifiertoken- opaque native provider tokenplatform- Codename One platform nameinstallationId- stable application installation identifierexpiresAt- expiration time in epoch milliseconds, or0when the provider supplies no expirycapabilities- immutable capability identifiers, ornull- Throws:
IllegalArgumentException- iftransportIdortokenis null, blank, or has surrounding whitespace
-
-
Method Details
-
getTransportId
Returns the provider identifier used for delivery routing.- Returns:
- the transport identifier
-
getToken
-
getPlatform
Returns the Codename One platform name reported at registration.- Returns:
- the platform name
-
getInstallationId
Returns the stable ID for this application installation.- Returns:
- the installation identifier
-
getExpiresAt
public long getExpiresAt()Returns the subscription expiry time.- Returns:
- epoch milliseconds, or
0when no expiry is known
-
getCapabilities
-