register method

Future<User> register(
  1. String userId,
  2. String activationToken,
  3. String pin, [
  4. String? pushToken,
])

Implementation

Future<User> register(String userId, String activationToken, String pin, [ String? pushToken ]) async {
  try {
    final mUser = await _sdk.register(userId, activationToken, pin, pushToken);
    final user = mUser._toUser();

    return user;
  } on PlatformException catch(e) {
    final exceptionCode = e._getExceptionCode();
    if (exceptionCode is RegistrationExceptionCode) {
      throw RegistrationException._create(
        exceptionCode,
        e.details["error"]
      );
    } else {
      rethrow;
    }
  }
}