createConnectionLegacy static method

Future<SpikeConnectionV3> createConnectionLegacy({
  1. required String appId,
  2. required String authToken,
  3. required String customerEndUserId,
  4. String? desiredConnectionId,
})

Implementation

static Future<SpikeConnectionV3> createConnectionLegacy({
  required String appId,
  required String authToken,
  required String customerEndUserId,
  String? desiredConnectionId,
}) async {
  await NativeSDKBridgeV3.setWrapper(
    type: "Flutter",
    version: PackageVersion.version,
  );

  final connectionId = desiredConnectionId ?? UuidGenerator.generateV4();

  final result = await NativeSDKBridgeV3.createConnectionLegacy(
    connectionId: connectionId,
    appId: appId,
    authToken: authToken,
    customerEndUserId: customerEndUserId,
  );

  ExceptionHandler.checkException(result);

  final connection = SpikeConnectionV3.fromParameters(
      connectionId: connectionId, appId: appId, customerEndUserId: customerEndUserId);
  _connections[connectionId] = connection;

  return connection;
}