registerDevice method
Future<DynamiteResponse<PushRegisterDeviceResponseApplicationJson, void> >
registerDevice({
- required String pushTokenHash,
- required String devicePublicKey,
- required String proxyServer,
- PushRegisterDeviceApiVersion? apiVersion,
- bool? oCSAPIRequest,
Register device for push notifications.
Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.
Parameters:
pushTokenHashHash of the push token.devicePublicKeyPublic key of the device.proxyServerProxy server to be used.apiVersionDefaults tov2.oCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 200: Device was already registered
- 201: Device registered successfully
- 400: Registering device is not possible
- 401: Missing permissions to register device
See:
- registerDeviceRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.
Implementation
Future<DynamiteResponse<PushRegisterDeviceResponseApplicationJson, void>> registerDevice({
required String pushTokenHash,
required String devicePublicKey,
required String proxyServer,
PushRegisterDeviceApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final rawResponse = registerDeviceRaw(
pushTokenHash: pushTokenHash,
devicePublicKey: devicePublicKey,
proxyServer: proxyServer,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
return rawResponse.future;
}