send method

  1. @override
Future<String> send({
  1. required Uint8List data,
  2. required BridgefyTransmissionMode transmissionMode,
})
override

Implementation

@override
Future<String> send({
  required Uint8List data,
  required BridgefyTransmissionMode transmissionMode,
}) async {
  final initialized = await _isInitialize();
  final started = await _isStarted();
  assert(initialized, 'Bridgefy is not initialized');
  assert(started, 'Bridgefy is not started');
  try {
    final result = await methodChannel.invokeMethod(
      'send',
      {
        "data": data,
        "transmissionMode": {
          "mode": transmissionMode.type.name,
          "uuid": transmissionMode.uuid
        },
      },
    );
    return result["messageId"] as String;
  } on PlatformException catch (e) {
    throw _bridgefyException(e);
  }
}