MoEngageImpl constructor

MoEngageImpl({
  1. required String workspaceId,
  2. bool enableLogs = false,
})

Creates or returns the singleton instance of MoEngageImpl.

Implementation

factory MoEngageImpl({required String workspaceId, bool enableLogs = false}) {
  if (!_instance._initialized) {
    try {
      _instance._initialize(workspaceId, enableLogs);
    } catch (e) {
      debugPrint('MoEngage: Initialization failed: $e');
      rethrow;
    }
  }
  return _instance;
}