Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public static final class PushClient.Builder
- Object
- PushClient.Builder
Configures a PushClient.
A PushListener is required. Without a custom
PushTransport, the client uses the platform transport and
BuildCloud registration. Supplying a custom transport bypasses BuildCloud
and also requires a PushRegistrationSink so the application can
maintain its own server-side subscription.
Methods
Inherited methods
Method details
listener
public PushClient.Builder listener(PushListener value)Parameters
valuePushListener- the non-null listener retained for the life of the client
Returns
registrationSink
public PushClient.Builder registrationSink(PushRegistrationSink value)Mirrors subscription changes to application-owned code.
For managed push this is optional and runs in addition to BuildCloud registration. For a custom transport it is required.
Parameters
valuePushRegistrationSink- the registration sink, or
nullfor managed push
Returns
transport
public PushClient.Builder transport(PushTransport value)Replaces the managed native transport.
Setting this option prevents PushClient from contacting
BuildCloud. The transport must emit schema-3 envelopes and the builder
must also receive a registrationSink(PushRegistrationSink).
Parameters
valuePushTransport- a custom native transport, or
nullto use managed platform push
Returns
build
public PushClient build()Returns
Throws
IllegalStateException- if no listener is configured, or if a custom transport has no registration sink