register method

  1. @override
Future<void> register(
  1. String firebaseAccessToken
)
override

Implementation

@override
Future<void> register(String firebaseAccessToken) async {
  final projectId = core.projectId;
  final clientId = await core.crypto.getClientId();
  final response = await echoClient.register(
    projectId: projectId,
    clientId: clientId,
    firebaseAccessToken: firebaseAccessToken,
  );

  if (response.status != SUCCESS_STATUS) {
    if (response.errors != null && response.errors!.isNotEmpty) {
      throw ArgumentError(response.errors!.first.message);
    }

    throw Exception('Unknown error');
  }
}