registerWith static method

void registerWith(
  1. Registrar registrar
)

Registers all method channel handlers for RASP, screen, memory, and location.

Implementation

static void registerWith(Registrar registrar) {
  // RASP channel
  final raspChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chRasp),
    const StandardMethodCodec(),
    registrar,
  );
  raspChannel.setMethodCallHandler(_handleRaspCall);

  // Screen channel
  final screenChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chScreen),
    const StandardMethodCodec(),
    registrar,
  );
  screenChannel.setMethodCallHandler(_handleScreenCall);

  // Memory channel
  final memoryChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chMemory),
    const StandardMethodCodec(),
    registrar,
  );
  memoryChannel.setMethodCallHandler(_handleMemoryCall);

  // Location channel
  final locationChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chLocation),
    const StandardMethodCodec(),
    registrar,
  );
  locationChannel.setMethodCallHandler(_handleLocationCall);

  // New v2.0.0 channels
  final secureStorageChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chSecureStorage),
    const StandardMethodCodec(),
    registrar,
  );
  secureStorageChannel.setMethodCallHandler(_handleSecureStorageCall);

  final biometricChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chBiometric),
    const StandardMethodCodec(),
    registrar,
  );
  biometricChannel.setMethodCallHandler(_handleBiometricCall);

  final deviceBindingChannel = MethodChannel(
    ShieldCodec.d(ShieldCodec.chDeviceBinding),
    const StandardMethodCodec(),
    registrar,
  );
  deviceBindingChannel.setMethodCallHandler(_handleDeviceBindingCall);
}