public final class PushSubscription
- Object
- 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.
Constructors
Methods
public String getTransportId() | Returns the provider identifier used for delivery routing. |
public String getToken() | Returns the opaque native provider token. |
public String getPlatform() | Returns the Codename One platform name reported at registration. |
public String getInstallationId() | Returns the stable ID for this application installation. |
public long getExpiresAt() | Returns the subscription expiry time. |
public List<String> getCapabilities() | Returns transport capability identifiers. |
Inherited methods
Constructor details
PushSubscription
public PushSubscription(String transportId, String token, String platform, String installationId, long expiresAt, List<String> capabilities)Creates a subscription, primarily for custom
PushTransport
implementations.Parameters
transportIdString- stable provider identifier
tokenString- opaque native provider token
platformString- Codename One platform name
installationIdString- stable application installation identifier
expiresAtlong- expiration time in epoch milliseconds, or
0when the provider supplies no expiry capabilitiesList<String>- immutable capability identifiers, or
null
Throws
IllegalArgumentException- if
transportIdortokenis null, blank, or has surrounding whitespace
Method details
getTransportId
public String getTransportId()Returns the provider identifier used for delivery routing.
Returns
the transport identifier
getToken
public String getToken()Returns the opaque native provider token.
Returns
the native token
getPlatform
public String getPlatform()Returns the Codename One platform name reported at registration.
Returns
the platform name
getInstallationId
public String 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
0 when no expiry is knowngetCapabilities
public List<String> getCapabilities()Returns transport capability identifiers.
Returns
an immutable, possibly empty list