initialize method

Future<void> initialize(
  1. MoEngageFlutter moengagePlugin
)

Initializes the MoEngage notification handler.

Implementation

Future<void> initialize(MoEngageFlutter moengagePlugin) async {
  if (_initialized) {
    debugPrint('MoEngage notifications already initialized');
    return;
  }

  try {
    _moengagePlugin = moengagePlugin;

    await _registerHandlers();
    // await _setupPushToken();

    _initialized = true;
  } catch (e) {
    debugPrint('Error initializing MoEngage notification handler: $e');
  }
}