logPurchase method

void logPurchase(
  1. String productId,
  2. String currencyCode,
  3. double price,
  4. int quantity,
  5. {Map<String, dynamic>? properties}
)

Logs a purchase event to Braze.

Implementation

void logPurchase(
    String productId, String currencyCode, double price, int quantity,
    {Map<String, dynamic>? properties}) {
  final Map<String, dynamic> params = <String, dynamic>{
    "productId": productId,
    "currencyCode": currencyCode,
    "price": price,
    "quantity": quantity,
  };
  if (properties != null) {
    // Omits entry when properties is null
    params["properties"] = properties;
  }
  _channel.invokeMethod('logPurchase', params);
}