Fluent builder for the VAPID keys, subscriber subscription and payload needed to send a web push notification through HttpPushManager.sendNotification. Created with HttpPushManager.notificationBuilder, then configured with the with* methods before being handed to a push service for delivery.

Group: Builders


Properties

PropertyReturnsDescription
endPointStringPush service endpoint URL for the subscriber's browser, as supplied by the browser's push subscription.
payloadStringPlain-text message content that will be encrypted and delivered to the subscriber as the body of the push notification.
privateKeyStringVAPID private key used to sign the push request, in the format required by the push service (e.g. base64 encoded).
publicKeyStringVAPID public key identifying the application server to the push service.
subjectStringVAPID subject identifying the sender to the push service, typically a mailto: or https: URI.
userAuthStringSubscriber's auth secret from their browser push subscription, used together with the user public key to encrypt the notification payload.
userPublicKeyStringSubscriber's public key from their browser push subscription, used to encrypt the notification payload.

Methods

getPrivateKey() · withPrivateKey(String privateKey) · getPublicKey() · withPublicKey(String publicKey) · getSubject() · withSubject(String subject) · getEndPoint() · withEndpoint(String endPoint) · getUserPublicKey() · withUserPublicKey(String userPublicKey) · getUserAuth() · withUserAuth(String userAuth) · getPayload() · withPayload(String payload)

getPrivateKey()

Returns: String

VAPID private key used to sign the push request, in the format required by the push service (e.g. base64 encoded).

withPrivateKey(String privateKey)

Returns: NotificationBuilder

Sets the VAPID private key used to sign the push request.

ParameterDescription
privateKeythe VAPID private key, in the format required by the push service

getPublicKey()

Returns: String

VAPID public key identifying the application server to the push service.

withPublicKey(String publicKey)

Returns: NotificationBuilder

Sets the VAPID public key identifying the application server to the push service.

ParameterDescription
publicKeythe VAPID public key

getSubject()

Returns: String

VAPID subject identifying the sender to the push service, typically a mailto: or https: URI.

withSubject(String subject)

Returns: NotificationBuilder

Sets the VAPID subject identifying the sender to the push service.

ParameterDescription
subjectthe VAPID subject, typically a mailto: or https: URI

getEndPoint()

Returns: String

Push service endpoint URL for the subscriber's browser, as supplied by the browser's push subscription.

withEndpoint(String endPoint)

Returns: NotificationBuilder

Sets the push service endpoint URL for the subscriber's browser.

ParameterDescription
endPointthe subscriber's push endpoint URL, as supplied by the browser's push subscription

getUserPublicKey()

Returns: String

Subscriber's public key from their browser push subscription, used to encrypt the notification payload.

withUserPublicKey(String userPublicKey)

Returns: NotificationBuilder

Sets the subscriber's public key from their browser push subscription.

ParameterDescription
userPublicKeythe subscriber's public key, used to encrypt the notification payload

getUserAuth()

Returns: String

Subscriber's auth secret from their browser push subscription, used together with the user public key to encrypt the notification payload.

withUserAuth(String userAuth)

Returns: NotificationBuilder

Sets the subscriber's auth secret from their browser push subscription.

ParameterDescription
userAuththe subscriber's auth secret, used to encrypt the notification payload

getPayload()

Returns: String

Plain-text message content that will be encrypted and delivered to the subscriber as the body of the push notification.

withPayload(String payload)

Returns: NotificationBuilder

Sets the plain-text message content to be delivered to the subscriber as the body of the push notification.

ParameterDescription
payloadthe notification payload
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.