sendAttribute static method

Future<void> sendAttribute(
  1. String attributeName,
  2. String attributeValue
)

Sends an attribute with the specified attributeName and attributeValue.

This method invokes the native method sendAttribute.

Throws a PlatformException if the attribute sending fails.

attributeName: The name of the attribute to send. attributeValue: The value of the attribute to send.

Implementation

static Future<void> sendAttribute(
    String attributeName, String attributeValue) async {
  const platform = MethodChannel('mergnKotlinSDK');
  try {
    await platform.invokeMethod('sendAttribute',
        {"attributeName": attributeName, "attributeValue": attributeValue});
  } on PlatformException catch (e) {
    print("Failed to send attribute: '${e.message}'.");
  }
}