initSdk method
Implementation
@override
Future<String?> initSdk(CXExporterOptions options) async {
var arguments = options.toMap();
// Remove beforeSend from arguments as it cannot be serialized
arguments.remove('beforeSend');
arguments['pluginVersion'] = PluginInfo.version;
arguments['hasBeforeSend'] = options.beforeSend != null;
final version = await methodChannel.invokeMethod<String>('initSdk', arguments);
// beforeSend is optional: only set up listener when provided; otherwise native SDK sends events directly.
if (options.beforeSend != null) {
_beforeSendCallback = options.beforeSend;
_startListening();
} else {
_beforeSendCallback = null;
stopListening();
}
return version;
}