isOnboarded method

  1. @override
Future<bool> isOnboarded(
  1. String atSign
)
override

Checks whether the provided atSign has been onboarded. Returns true if the atSign is onboarded; otherwise, returns false.

 final String atSign = '@alice'; // Represents the atSign to onboard.
 final String cramKey = 'abc123'; // Represents the key used for CRAM Authentication which is fetched from the QR code.
 final AtClientPreferences atClientPreferences = AtClientPreferences();
 AtAuthService atAuthService = AtClientMobile.authService(atSign, atClientPreferences);

 AtAuthService atAuthService = AtClientMobile.isOnboarded(atSign);

Implementation

@override
Future<bool> isOnboarded(String atSign) async {
  AtsignKey? atsignKey = await keyChainManager.readAtsign(name: atSign);
  if (atsignKey == null) {
    return false;
  }
  if (atsignKey.encryptionPublicKey == null ||
      atsignKey.encryptionPublicKey!.isEmpty) {
    return false;
  }
  return true;
}