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
| Property | Returns | Description |
|---|---|---|
| endPoint | String | Push service endpoint URL for the subscriber's browser, as supplied by the browser's push subscription. |
| payload | String | Plain-text message content that will be encrypted and delivered to the subscriber as the body of the push notification. |
| privateKey | String | VAPID private key used to sign the push request, in the format required by the push service (e.g. base64 encoded). |
| publicKey | String | VAPID public key identifying the application server to the push service. |
| subject | String | VAPID subject identifying the sender to the push service, typically a mailto: or https: URI. |
| userAuth | String | Subscriber's auth secret from their browser push subscription, used together with the user public key to encrypt the notification payload. |
| userPublicKey | String | Subscriber'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.
| Parameter | Description |
|---|---|
privateKey | the 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.
| Parameter | Description |
|---|---|
publicKey | the 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.
| Parameter | Description |
|---|---|
subject | the 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.
| Parameter | Description |
|---|---|
endPoint | the 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.
| Parameter | Description |
|---|---|
userPublicKey | the 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.
| Parameter | Description |
|---|---|
userAuth | the 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.
| Parameter | Description |
|---|---|
payload | the notification payload |