public final class PushSubscription

  1. Object
  2. 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

public PushSubscription(String transportId, String token, String platform, String installationId, long expiresAt, List<String> capabilities)Creates a subscription, primarily for custom PushTransport implementations.

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

transportId String
stable provider identifier
token String
opaque native provider token
platform String
Codename One platform name
installationId String
stable application installation identifier
expiresAt long
expiration time in epoch milliseconds, or 0 when the provider supplies no expiry
capabilities List<String>
immutable capability identifiers, or null

Throws

IllegalArgumentException
if transportId or token is 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 known

getCapabilities

public List<String> getCapabilities()
Returns transport capability identifiers.

Returns

an immutable, possibly empty list