Class RegisterE2EMobilePushDevice
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.server.request.RegisterE2EMobilePushDevice
- All Implemented Interfaces:
VoidExecutableApiRequest
public class RegisterE2EMobilePushDevice
extends ZulipApiRequest
implements VoidExecutableApiRequest
Zulip API request builder for registering a E2E mobile push device.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRegisterE2EMobilePushDevice(ZulipHttpClient client, long deviceId) Constructs aRegisterE2EMobilePushDevice. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the Zulip API request for registering a E2E mobile push device.withPushKey(long pushKeyId, String pushKey) Sets the push key used to encrypt push notifications for the device.withToken(TokenKind tokenKind, String tokenId, String bouncerPublicKey, String encryptedPushRegistration) Sets the FCM or APNs token for the device.Methods inherited from class ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
DEVICE_ID
- See Also:
-
PUSH_KEY_ID
- See Also:
-
PUSH_KEY
- See Also:
-
TOKEN_KIND
- See Also:
-
TOKEN_ID
- See Also:
-
BOUNCER_PUBLIC_KEY
- See Also:
-
ENCRYPTED_PUSH_REGISTRATION
- See Also:
-
-
Constructor Details
-
RegisterE2EMobilePushDevice
Constructs aRegisterE2EMobilePushDevice. An initial registration must set both the push key, viawithPushKey(long, String), and the token, viawithToken(TokenKind, String, String, String). An existing registration can rotate either one on its own.- Parameters:
client- The Zulip HTTP clientdeviceId- The id of the device returned byregisterClientDevice()
-
-
Method Details
-
withPushKey
Sets the push key used to encrypt push notifications for the device.- Parameters:
pushKeyId- The id of the push key, included in notifications so the device can identify which key to usepushKey- The push key, prefixed by a byte identifying the encryption scheme and encoded using an RFC 4648 standard base64 encoder- Returns:
- This
RegisterE2EMobilePushDeviceinstance - See Also:
-
withToken
public RegisterE2EMobilePushDevice withToken(TokenKind tokenKind, String tokenId, String bouncerPublicKey, String encryptedPushRegistration) Sets the FCM or APNs token for the device.- Parameters:
tokenKind- TheTokenKindfor how the token was generatedtokenId- The id of the token, generated by the clientbouncerPublicKey- Bouncer public key encoded using an RFC 4648 standard base64 encoderencryptedPushRegistration- Ciphertext generated by encrypting a PushRegistration map using the bouncer public key, encoded using an RFC 4648 standard base64 encoder- Returns:
- This
RegisterE2EMobilePushDeviceinstance - See Also:
-
execute
Executes the Zulip API request for registering a E2E mobile push device.- Specified by:
executein interfaceVoidExecutableApiRequest- Throws:
ZulipClientException- if the request was not successful
-