sendEvent static method

Future<bool> sendEvent({
  1. required String eventName,
  2. required String appToken,
  3. String? identifier,
  4. String? registration,
  5. Map<String, dynamic> eventValues = const {},
  6. bool conversionEvent = false,
  7. double conversionValue = 0,
  8. String conversionNotId = '',
})

Implementation

static Future<bool> sendEvent({
  required String eventName,
  required String appToken,
  String? identifier,
  String? registration,
  Map<String, dynamic> eventValues = const {},
  bool conversionEvent = false,
  double conversionValue = 0,
  String conversionNotId = '',
}) async {
  if (identifier == null && registration == null) {
    debugPrint(
      'Unfortunately it was not possible send an event,'
      ' you need to declare the identifier or registration',
    );
  }
  try {
    await InngageService.registerEvent(
      InngageProperties.registration,
      eventName,
      eventValues,
      conversionEvent,
      conversionValue,
      conversionNotId,
    );
  } catch (e) {
    return false;
  }
  return true;
}