unregister method

  1. @override
Future<void> unregister()
override

Implementation

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

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

    throw Exception('Unknown error');
  }
}