register method

  1. @override
Future<EchoResponse> register({
  1. required String projectId,
  2. required String clientId,
  3. required String firebaseAccessToken,
})
override

Implementation

@override
Future<EchoResponse> register({
  required String projectId,
  required String clientId,
  required String firebaseAccessToken,
}) async {
  final body = EchoBody(clientId: clientId, token: firebaseAccessToken);

  final url = Uri.parse('$baseUrl/$projectId/clients?auth=$clientId');
  final http.Response response = await httpClient.post(
    url,
    headers: headers,
    body: jsonEncode(body.toJson()),
  );

  final jsonMap = json.decode(response.body);
  return EchoResponse.fromJson(jsonMap);
}